One of the most common questions I get asked is how do I properly show Arabic characters in a client application.
Client applications are tools such as Toad, SQL Navigator, SQLPLUS or any other application that connects to a database via an Oracle client.
To view Arabic in such tools, you have to achieve 3 requirements:
- The database character-set has to be one of the following: AR8MSWIN1256, AR8ISO8859P6 or UTF-8.
- On your MS Windows client side, you need to set your nls_lang parameter to language_territory.AR8MSWIN1256. NLS_LANG parameter is available in Windows’s registry. A common value is AMERICAN_AMERICA.AR8MSWIN1256
- In your client application, select a font that supports Arabic characters.
But how do I diagnose on which layer the problem is?
For item 1, to find out your database character-set execute:
select * from v$nls_parameters where parameter = ‘NLS_CHARACTERSET’;
For items 2 & 3 use the dump function:
Dump function shows internal representation of a string. It is extremely useful in debugging character-set conversion issues.
select dump( ‘كيف حالك’ , 1016) my_test from dual;
Typ=96 Len=8 CharacterSet=AR8ISO8859P6: e3,ea,e1,20,cd,c7,e4,e3
you probably will execute something like:
Select dump(your_arabic_col, 1016) from your_arabic_table;
If dump function returns 3f (question mark), then your NLS_LANG is not set correctly.
If dump function returns proper representation and still you can’t see Arabic, then you are using a font that doesn’t support Arabic. But again, how do I know which font to use?
On MS Windows, I use charmap utility (start -> run -> type charmap -> enter)
This utility shows each font and its representation. Look for fonts that match AR8MSWIN1256 code page
Senior Oracle DBA