Felipe Monteiro de Carvalho wrote:
> On 10/20/06, Vincent Snijders <[EMAIL PROTECTED]> wrote:
>> This should be
>>    WideText := GetMem(Size*2);
>> because you get the number of characters, and the number of bytes 2*
>> number of
>> characters.
> 
> Thanks, it works, but I still have doubts.
> 
> 1) On linux I will need that cwstring unit, right? This was a utf-8
> test to be used on fpGUI, and possibly LCL. So can“t we just add
> cwstring on another unit instead of the first of the program?
> 
> 2) Does this work in case my string contains characters bigger then
> #FFFF ? I mean, it seams that we suppose that each character will have
> 2 bytes, but this may not be true.

IMO, Utf8ToUnicode should return the number of bytes the unicode string
requires and not the number of characters. Since even for unicode, one
char may take more than one word.

I don't know what it returns atm.

Marc


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to