texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] character encoding


From: Joris van der Hoeven
Subject: Re: [Texmacs-dev] character encoding
Date: Tue, 28 Jan 2003 14:28:16 +0100 (MET)

> Any idea why?

Yes: you should use delete[] instead of delete
in order to delete arrays.

> This is the chunk of code I am referring to:
> 
>   while (inbytesleft > 0) {
>     size_t out_buf_len = max(inbytesleft,10);
>     size_t outbytesleft = out_buf_len;
>     char* out_buf = new char[out_buf_len];
>     char* start_out_buf = out_buf;
>     size_t flag = iconv (cd, &in_buf, &inbytesleft, &out_buf, &outbytesleft);
>     if(flag==(size_t)-1 && errno != E2BIG) { system_error("String conversion 
> using iconv failed!"); return "";}
>     result << string(start_out_buf, out_buf_len - outbytesleft);
>     delete out_buf;
>   }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]