Page 1 of 1

characterset display problem with hebrew characters

Posted: Thu 04 Aug 2011 07:40
by albourgz
Using bcb 2010, odac 6.90.0.57.
DB Server= oracle 10g xe (10.2.0.1.0) on windows xp pro UK.
Server db characterset: AL32UTF8 (AMERICAN_AMERICA).

On client computer: oracle 10.2.0.3.0, windows vista Business UK SP1.
registry: HKLM\software\oracle\KeyOraClient10g_home1\NLS_LANG=AMERICAN_AMERICA.AL32UTF8
environment: NLS_LANG=AMERICAN_AMERICA.AL32UTF8

I have a table with data in hebrew (varchar2(50 char)).
Problem:
* using sql developer, select * from table displays correct Hebrew characters (so far so good),
* using odac (db grid or select), I can't get the characters to be displayed correctly,
* I know that the same application on a Hebrew windows (with same oracle version) displays data correctly, the difference is that it is an Hebrew windows, and characterset is AMERICAN_AMERICA.IW8ISO8859P8,
* Hebrew data is also displayed correctly on my computer if retrieved from a web service (not from db via odac),
* charset and clientidentifier are not set in TOraSession's options,
* I don't use the ODAC Direct option,
* the option UseUnicode is false.

Question: which NLS_LANG do I have to use to retrieve data correctly (changing characterset displays another garbage, but not Hebrew on my computer) on a UK windows?

Regards.

Posted: Thu 04 Aug 2011 09:19
by AlexP
Hello,

To display Unicode symbols correctly, you should turn on the UseUnicode option:

OraSession1.Options.UseUnicode := True;

don't agree

Posted: Thu 04 Aug 2011 09:31
by albourgz
1. In Israƫl, it works although UseUnicode=false. So it is feasable to make it work without using UseUnicode,
2. If I set Use Unicode to true, I have to rewrite everything (every string field has to be converted to WideString), and the application is too big,
3. the property AsString, since bcb 2009, returns UnicodeString. So should be able to hold unicode without having to use a WideString,
4. And even before bcb6, AnsiString can hold anything using UTF8. UTF8 is NOT unicode but can store anything,
5. The bcb 2010 string can hold Hebrew without any problem: when retrieved through a web service (also using utf8), display occurs correctly.

Posted: Tue 09 Aug 2011 07:15
by AlexP
Hello,

Displaying of UniCode symbols depends not only on the settings of your Oracle client and server, but also on the Windows local language settings, that's why symbols of one language can be displayed correctly even if the UseUnicode option is off, and symbols of another language can be displayed incorrectly. That's why you should turn the UseUnicode option on.

Logic

Posted: Tue 23 Aug 2011 13:39
by albourgz
I understand what you mean.
However, I don't understand your component's logic, what you say is:
If you check "UseUnicode" your string will not be mapped to UnicodeString but to WideStrings. And database strings will never be mapped to UnicodeString correctly, even if the AsString property returns... a UnicodeString.

You should name your property "UseWideStrings" in this case.
The UnicodeString allows me to retrieve any hebrew string through web services from a (French) windows-vista computer, so the problem is not the OS.

I don't understand why, If I can read it using a web service, I can't read it in database using odac (on this computer, sqldeveloper displays database hebrew varchars correctly, so problem is also not the OS).