UTF8 to Unicode conversion

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
kjuelge
Posts: 2
Joined: Thu 01 Jun 2006 11:08

UTF8 to Unicode conversion

Post by kjuelge » Thu 01 Jun 2006 11:31

Hello,

I recently started using TntWare visual components in order ot display Chinese and other characters in my application. I use ODAC version 5.70.0.29 to connect to our database (which is Oracle 10g R10.2.0.2.0, by the way). The development tool is Borland 2006 for Windows, language is C++.

I set the NLS_LANG setting to GERMAN_GERMANY.ATL32UTF8 for the Oracle client in the registry.

In the application, I set TOraSession.Options.CharLength=0, CharSet=AL32UTF8 and UseUnicode=false.

I can see in the debugger that correct UTF8-encoded strings arrive. I use a TntDBMemo to display a CLOB field from a table. The table is represented by a TOraTable object. The dataset property of the TntDBMemo is set to this object.

The problem is now that the TntDBMemo displays the UTF8 string as it is. It is not decoded and converted to a WideString. I thought someone along the line (either ODAC or TntWare) has to do the conversion. I can do it myself (which works fine), but that would defeat the purpose of data-sensitive components because I have to update the string everytime a record is modified or the dataset switches to the next record.

Am I missing something here? Help would be greatly appreciated.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Thu 01 Jun 2006 12:32

You can set Options.UseUnicode property of TOraSession component to True. In this case all character data is stored as WideStrings, and TStringField is replaced with TWideStringField. Also you should set Options.CharLength to 0 and Options.Charset to empty string.

kjuelge
Posts: 2
Joined: Thu 01 Jun 2006 11:08

Post by kjuelge » Thu 01 Jun 2006 12:36

Ok. I tried exactly that.

Now Chinese characters are displayed as ??????.

Alex
Posts: 655
Joined: Mon 08 Nov 2004 08:39

Post by Alex » Mon 05 Jun 2006 08:01

We cannot reproduce this problem. Please tell us do you use client to connect to Oracle or you connect using Net option.
Check if East Asian languages are installed on your computer. (Go to Control Panel\Regional and Language Options, Languages tab. "Install files for East Asian languages" must be checked.)
If it is possible send to ODAC support address a sample that demonstrates the problem.

Post Reply