• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Help required in implementing internationalization in JSP

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using JSP on weblogic 6. I am trying to implement localization in JSP
to display locale specific text in the HMTL page rendered as well as for the
data obtained from the database.
For rendering locale-specific labels in the HTML page I have fetched the
text from resource bundles and added the <%@ page contentType="text/html;
charset=UTF-8" %> tag to the JSP. With this I am able to view the different
characters in different languages properly. But the data stored in the
database as Unicode characters (eg Japanese characters) when fetched and
displayed show junk.
For displaying data retrieved from the database correctly, the <%@ page
contentType="text/html; charset=UTF-8" %> tag has to be removed from the JSP
code and the browser (IE 5.0) encoding needs to be set as UTF-8 but then the
label fetched from property files are displayed as junk.
To sum it up, if I have the browser settings then labels fetched from
property files as displayed as junk.
and if I have <%@ page contentType="text/html; charset=UTF-8" %> set in the
JSP then data fetched from the data base is displayed as junk
I have my resource bundle file defined as follows:
web_jp_JP.properties
namekey=\u4e00 \u4e98
Does any one have any idea how to display both the data correctly.
Thanks in advance.
Regards,
Moin
 
Saloon Keeper
Posts: 22267
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To start with, Japanese needs a 16-bit character encoding. UTF-8 isn't wide enough.
 
    Bookmark Topic Watch Topic
  • New Topic