gnokii-users
[Top][All Lists]
Advanced

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

Re: Unicode support


From: Pawel Kot
Subject: Re: Unicode support
Date: Fri, 27 Sep 2002 10:39:17 +0200

>>> address@hidden 27 September 2002 10:20:55 >>>
> >>void char_decode_unicode(unsigned char* dest, const unsigned char* src, int 
> >>len)
> >>{
> >>int i;
> >>
> >>for (i = 0; i < len; i++)
> >>wctomb(dest + strlen(dest), (src[i * 2] << 8) | src[(i * 2) + 1]);
> >>return;
> >>}
> Why wouldn't it support wider characters? wctomb adds them to the end
> of dest. If it's 4 Bytes it adds four bytes. The version now in CVS
> just discards wider characters.

Okay. You are right. Two things:
1. Avoid strlen. It extremly slow.
2. You need to do this in two more functions. decode_ucs2 and
decode_unicode_alphabet() [or similiar].

pkot





reply via email to

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