RE: Bug in gwlib/charset.c: int charset_convert(Octstr *string, c har *charset_from, char *charset_to)
Alexander Malysh <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Joerg, IMO, it's a bug. please post a patch, I will commit it... "Pommnitz, Jörg" wrote: > No comment? > > -----UrsprÌngliche Nachricht----- > Von: Pommnitz, Jörg > Gesendet: Montag, 22. November 2004 12:22 > An: Kannel-Devel (E-Mail) > Betreff: Bug in gwlib/charset.c: int charset_convert(Octstr *string, > char *charset_from, char *charset_to) > > > Hi List, > the above mentioned function seems buggy to me. It takes the result of the > iconv operation and uses octstr_append_cstr(string, to_buf); to replace > the old contents with the new one. This can't possibly work when you > convert to say UTF-16 with zero-bytes in the middle of the result (quite > likely). I don't have a patch, but the right solution would probably be to > use > > octstr_append_data(string, to_buf, pointer - to_buf); > > instead of > > octstr_append_cstr(string, to_buf); > > Regards > Joerg -- Thanks, Alex