[fpc-devel] Unicode conversion routines

Graeme Geldenhuys graemeg.lists at gmail.com
Sun Nov 23 00:42:45 CET 2008


On Sat, Nov 22, 2008 at 9:07 PM, Florian Klaempfl
<florian at freepascal.org> wrote:
>
> See http://bugs.freepascal.org/view.php?id=11791

OK, but that bug report is about an invalid sequence and getting out
NULL.  I'm testing perfectly valid UTF-8 sequence and still getting
NULL result.


>>   // U+289A8 CJK UNIFIED IDEOGRAPH-289A8
>>   s8 := Char($F0) + Char($A8) + Char($A6) + Char($A8);
>>   s16 := UTF8Decode(s8);
>>
>>   AssertEquals('Failed on 4', 4, Length(s16));
>>   AssertEquals('Failed on 5', UnicodeChar($D862) + UnicodeChar($DDA8), s16)
>>
>> end;
>>
>> Test 4 fails: Expected 4 but was 0.
>> Test 5 fails: to due to Test 4 failure...
>>
>>
>> ---------------[  from unicode description file ]-----------------------
>> U+289A8 CJK UNIFIED IDEOGRAPH-289A8
>>
>> General Character Properties
>>
>> Unicode category: Letter, Other
>>
>> Various Useful Representations
>>
>> UTF-8: 0xF0 0xA8 0xA6 0xA8
>> UTF-16: 0xD862 0xDDA8
>> ------------------------[ end ]----------------------------


Regards,
  - Graeme -


_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/



More information about the fpc-devel mailing list