• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Displaying Arabic characters on iWS 6

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sure this problem is trivial but i've searched all over the forums on the iPlanet support sites and couldn't get something solid.
I am running my JSP's on iWS 6 and all is fine until the page contains characters of a certain encoding ( mainly the windows-1256 )
i tried ofcourse setting the encoding on the HTML meta tag like this :

only works for static HTML pages but when the file is .jsp ( ie gets parsed by the JSP compiler ) doesn't work.
so i tried setting it using the JSP tag :

now something happens .. instead of getting the funny looking characters i get question marks '?'
i even set encoding variables in the magnus.con file etc .. still no solution.
i hope someone can help in this.
Thanks in advance.
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Try the following......
1.In the JSP scriplet i.e in contentType......
charset="cp1256".
2.You should have the arabic equivalent of "_AR.properties" file for all the name-value pairs.
Example:
File Name : example_AR.properties
SUNONE="....hex code equivalent of the word SUNONE..".
Also, you need to use ResourceBundle.
ResourceBundle rb=ResourceBundle.getBundle("fileName",Locale);
In jsp, to print the Arabic version of SUNONE, you should call,
<%= rb.getString("SUNONE") %>
Refer sun documentation on creating a Locale for Arabic.
Rgds,
Selvaraj Suresh
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx Suresh for your reply.
1. putting cp1256 in my jsp scriptlet just messes up the page ( gives a Server error and the JSP isn't compiled )
2. I don't think my problem requires going through the hassle of locales, I mean it's as simple as adding the HTML header in the jsp page.
See .html files show the arabic ok when i have this header

that's because it is not handled by the JSP comipler of the webserver.
on the other hand .jsp files are not showing the arabic characters correctly ( even if it was the same .html file but just renamed the extension )
when the page shows on the browser the encoding selected is Western European (ISO). Which means it totally ignored the arabic headers i'm giving it on the HTML level, in the JSP level .. and even on the webserver level ( when i editted the magnus.conf file )
can't seem to find any support on this matter anywhere .. do you have any support sites other than the one provided by sun?
Hope someone can help!
 
Suresh Selvaraj
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You may want to try this.
1.In Windows 2000, start -->settings -->Control Panel-->Regional Options--> check(tick) Arabic option.
2.In "Set Default", select Arabic (Saudi Arabia).
3.In your system environment path settings, include the following name-value pairs.
NLS_LANG ---> Arabic_Saudi Arabia.UTF8
NLS_DISPLAY ---> _.UTF8
I am sure, now you should be able to see the Arabic characters.
Regards,
Selvaraj Suresh
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok Suresh .. there seems to be some advancement with what you told me to do ... now instead of getting question marks for all the letters that are in arabic .. i have a mix of question marks and english letters.
tell me what was it that we did .. what were those env variables ?
and what other values cxan they have ?
so that i can try the combinations
It's so annoying but i'm sure someone has used it before and made it work.

but thanks for your help anyway
[ May 08, 2002: Message edited by: Kareem Gad ]
 
Suresh Selvaraj
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
By the way, are you trying to populate the JSP page by retrieving data from Oracle database?
If yes, then you need to do some more settings.
Also, ensure that your default Locale is Arabic - Saudi Arabia. [ check the Regional options ]
Rgds,
Selvaraj Suresh
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no Suresh i'm not using Oracle ... i am connecting to an MS SQL Server databse ..
See Suresh when this page is served thru another jsp engine like orion or apache or whatever .. it comes out right .. just thru iPlanet it gives this problem.
--------------
will stay
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suresh ,
Found the solution
Remember when you mentioned to put cp1256 for the charset in the jsp scriptlet i did just that .. but it was wrong.
The name of the charset turns out to be case sensitive and cp1256 shoul have actually been Cp1256.
for a list of supported encodings and their types you can find them here :
Supported Encodings
[ May 11, 2002: Message edited by: Kareem Gad ]
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi selva,
I read your replies for Arabic Support on web. I followed teh way you had explained. You also specified taht "whether r u using oracle database" in my case yes ! Please let me know what configurations i need to make on database so that my arabic characters are supported.
I changed teh column to nvarchar2(size) in teh DB column.
In my JSP i used meta tag that uses UTF-8 as charaset !
When i enter the arabic characters it is saved and when i view teh jsp page in teh web it displays the arabic characters prperly. If we repeat this step(of viewing the screen) sometimes it will display few characters as junk ('rectangle shape' will be displyed for few characters). Once it display the few characters as junk then wat ever time u view it will show same junk characters.
And even if i restart jdeveloper it will show few characters as junk.
Even i deployed in Oracle Appserver it shows few characters as junk.
Please help me out in this matter what extra steps i need to do !
I saved JSP page as UTF-8 mode !
regards
Sreenath.V
reply
    Bookmark Topic Watch Topic
  • New Topic