• 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 Japanese characters in JSP

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi friends,

I am trying to display japanese cahracters from the database. I am using EnterpriseDb has the Database. I am able to see the unicode data properly in the database. But when i display it in the database am getting ?? instead of the Japanese characters displayed. Please let me what should i do? AM i missing something???

Thanks in advance.

Regards,
Anand
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not very sure but I think before printing that japaneese character you need to set locale to japaneese.
 
Anand Natraj
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Girish,

Thank you very much for your reply.

I have set the locale to Japanese only but still am not able to view the data.

Regards,
Anand
 
Girjesh Trivedi
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
are you using "UTF-8" encoding for that page? if not set the page encoding to "UTF-8"
 
Anand Natraj
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Girjesh,

I have tried to set the encoding type to utf-8 and i have also charset as UTF-8. But i couldn't see the japanese characters yet. I am still seeing the ?? in my screen.

Thanks and Regards,
Anand
 
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
first check the following :

in browser try to change the html page encoding to your own locale and also try to change it to utf-8 , in FF you can use view / Character Encoding menu to change the page character encoding.

if it does not works , please try these steps and post back here if you faced problem.

you need to do :
1-set the page encoding to UTF-8 , something like :

<%@ page contentType="text/html;charset=UTF-8"%>

2-use meta tags to set the browser used encoding to UTF-8
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

3-you should(by my experiences) save the jsp file in UTF-8 encoding , IDEs do this automatically after you add 1 , but to ensure this you set the file encoding yourself.

do you read some text from a database and then try to show them on jsp page ?To make sure that your jsp file shows correct characters , use a bundle file add some messages to bundle file and use them in your jsp page.
[ September 18, 2006: Message edited by: Masoud Kalali ]
 
Anand Natraj
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Masoud,

Thanks a lot for your reply.

I tried the steps listed by you, except setting the browser locale to Japanese.
But unfortunately i couldn't succed. I tried opening the following site:

http://www.jsa.or.jp/default.asp

to check whether Japanese charachters are displayed in my site. The fonts where displayed fine from this site.

Please let me know if am missing something. Thanks in advance

Regards,
Anand
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried using Shift JIS? I have worked on a Japanese product for mobile devices. We used Shift JIS as the encoding.
[ September 18, 2006: Message edited by: Rashid Mayes ]
 
Masoud Kalali
Author
Posts: 531
Mac OS X Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
by looking at web site you name i found that they used


to force the browser to use Shift_JIS encoding when it shows the content . i never tried to use none unicode character encoding , so i can not comment on this item.

do you ever tried to change the encoing that browser uses for your web site?
try to set the the meta tag encoding to Shift_JIS , or let it be UTF-8 and then force the browser to use Shift_JIS by View/character encoding menu.

hth
 
Anand Natraj
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Thanks for your replies.

I tries using Shift JIS, but i couldn't see the japanese characters in my browser yet. I am using IE aas my browser. Can you please tell me how i will force my browser to use Shift JIS as the encoding??

Thanks in advance.

Thanks and Regards,
Anand
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


But the important thing is : what is the encoding of your data ?
You've said that it was unicode. It won't display properly if you're setting the page to Shift JIS. First, you have to make the following points clear :
1. What is the encoding in the database ?
2. How are you reading it ?
 
Anand Natraj
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Satou,

Thanks for your information.

I tried the same,but without any success.

Please find below the answers for your questions:

1. I am using EnterpriseDB as my database and am using EUC_JP as the encoding technique.
2. Am using Spring Framework and am reading the data from the databse using the DAO via a controller class.

Thanks in advance.

Thanks and Regards,
Anand
 
Let me tell you a story about a man named Jed. He made this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic