TWideMemoFields displayed with wrong characters

TWideMemoFields displayed with wrong characters

Postby fgomes » Mon 28 Sep 2009 14:54

Hi,

I tried to set the UseUnicode option to True and convert my TStringFields and TMemoFields to TWideStringField and TWideMemoField with the ftWideMemo option.

Everything is Ok with the TWideString Fields, but the TWideMemoFields are being displayed with incorrect characters (a lot of japanese/chinese chars actually).

I'm using Firebird 2.1 with the Win1252 charset on the database and Delphi 2009.

Also, if I set UseUnicode = True and then add a TMemoField with ftMemo, then some chars are displayed incorrectly, example: ã is displayed as ã.

If I'm not mistaken, the correct way to use everything as unicode is to convert all the fields to the "TWide" types, is it correct?

Is there something I can do to fix this?


Thanks.
fgomes
 
Posts: 7
Joined: Mon 24 Nov 2008 12:09

Postby Plash » Tue 29 Sep 2009 07:47

Check the character set of your BLOBs. TWideMemoField is created if the character set is UTF8 or UNICODE_FSS.

If the character set is WIN1252, TMemoField is created.
Plash
Devart Team
 
Posts: 2844
Joined: Wed 10 May 2006 07:09

Postby fgomes » Tue 29 Sep 2009 11:34

Plash wrote:Check the character set of your BLOBs. TWideMemoField is created if the character set is UTF8 or UNICODE_FSS.

If the character set is WIN1252, TMemoField is created.


The character set is WIN1252 indeed, but when it creates a TMemoField it displays the wrong characters, does it mean I'll have to change my blobs to UTF8?
fgomes
 
Posts: 7
Joined: Mon 24 Nov 2008 12:09

Postby Plash » Wed 30 Sep 2009 08:06

ã is ã encoded in UTF-8. So probably data in your BLOB are in UTF-8 encoding. Character set in the field declaration (WIN1252) does not correspond to the actual encoding of data. In this case you should change the character set of a BLOB field to UTF8 or UNICODE_FSS.
Plash
Devart Team
 
Posts: 2844
Joined: Wed 10 May 2006 07:09


Return to dbExpress driver for InterBase & Firebird