How to Show Arabic Characters in Your Client App

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:

  1. The database character-set has to be one of the following: AR8MSWIN1256, AR8ISO8859P6 or UTF-8.
  2. 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
  3. 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’;

Simple enough.

 

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;

MY_TEST
—————————————————————
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

 

Hazem Ameen
Senior Oracle DBA

Advertisements

7 thoughts on “How to Show Arabic Characters in Your Client App

  1. I recently had a similar problem in TOAD where I could only see garbage data in arabic tables. Everything that you mentioned here had already been done but it was not showing up.. The only problem was that the I used Arabic transparent font as the data grid font … and it was ok

    In TOAD 8.6 View > Options > Data Grid > Visual > Press Data button and select an Arabic font..

  2. hi sir,
    I can able to inser and retrieve data of arabic into respected field in the Windows Application.
    But when i am searching by arabic chareccters like
    Select arabic_field from arbic table where arabic_field like ‘%مر%’
    then its returning empty string even that charecter is there .. how to call it ??

  3. شكرا جزيلا اخى الكريم , جزاكم الله خيرا كثيرا, كنت ناسى خالص موضوع الخط ده , و شككنى فى نفسى

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s