• 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

Storing Arabic language

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am unable to store arabic words in database.

even i set request.setCharsetencoding("UTF-8") before fetching name, i get

??? ???.

kindly tell me the solution.

regards
Faisal
 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your database configured for UTF-8? Some databases use non-Unicode by default (for example, MySql before version 4.1).
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is your instance (Web Server / Application server) configured for Internationalization supporting Arabic language?
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by faisal ishaque:
I am unable to store arabic words in database.

even i set request.setCharsetencoding("UTF-8") before fetching name, i get



How are you determining that browser /client is sending the data using UTF-8 encoding ?
 
Krithika Srinath
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check whether browser encoding is set to UTF-8, from Edit -> Encoding(in IE not sure about the menu structure in other browsers). If not set that as well. However, as I have mentioned in my previous posts, I am suspecting that your app/web server is not configured for Arabic language.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Krithika Srinath:
You can check whether browser encoding is set to UTF-8


I can see the browser to see what encoding it has used.I would like to find this in the servlet.
I think this can be done to pin down the issue with character set.

You getCharacterEncoding() to see what encoding the browser has used to format this request.
That can be null also , as per the servlet specification if its null then it character set should be considered as Cp1252.

So in your case what is the character set you are getting in the servlet ?

If the browser is not sending its content in UTF-8 format then setting the encoding as UTF would not convert those bytes of different caracter set to Unicode.
[ September 18, 2007: Message edited by: Rahul Bhattacharjee ]
 
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Please do the following

Check if the database charset encoding is set to UTF-8. If not export your DB and recreate the database then re-import it.

Check if your JVM startup option -Dfile.encoding=UTF-8

Moreover you may need to set your Application server as

(eg in WebSphere we use to define setting as)

client.encoding.override=ISO-8859-1
default.client.encoding=UTF-8

Please confirm if it works
[ September 19, 2007: Message edited by: siva kumar ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic