[Asterisk-Dev] IAX spec: Text formats and character sets

Olle E. Johansson oej at edvina.net
Fri Apr 29 00:21:19 MST 2005


Kristian Nielsen wrote:
> Steve Underwood <steveu at coppice.org> writes:
> 
> 
>>There is no need to have ASCII + UTF-8. ASCII is a subset of UTF-8, so
>>they are fully compatible. Its only when you have 8 bit sets, like the
>>PC ones, that compatibility is an issue. Just define that all strings
>>in IAX2 are UTF-8, and that is the end of it.
> 
> 
> One problem is that strncpy(), which is used extensively in Asterisk,
> cannot be used on utf8 strings. The reason is that it might truncate the
> string in the middle of a multibyte character, leaving invalid utf-8
> data in the destination string.

Good observation! Thank you. What do we use instead?

/O



More information about the asterisk-dev mailing list