• 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

Accessing Japanese characters from text area

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Greetings to all,

I am having a JSP page with a textarea in it. I access the value entered in the text area using a servlet.

But when I type Japanese characters in the text area, in the servlet I am getting the value as '?'.

I even tried Request.setCharacterEncoding("ISO-2022-JP"); in the servlet before accessing the value from the text area. But still I am getting '?'.

Any help appreciated..

Thanks
priby
 
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

I even tried Request.setCharacterEncoding("ISO-2022-JP"); in the servlet before accessing the value from the text area.


First, make sure that your html is set to the correct encoding. For example, if your page is EUC encoded, you should have :

or UTF-8:


But still I am getting '?'.


Where ? How are checking the content ?
[ March 10, 2008: Message edited by: Christophe Verre ]
 
priby mathew
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Christophe,

As you suggested I added the following lines in my JSP:



In the servlet I'm using the following code for fetching the value (which has japanese characters) from JSP and writing it to html file:


When I open the testing.html in IE browser, I see only '?' for Jaapanese characters... I even changed the encoding of IE to UTF-8..

Thanks
priby
 
Christophe Verré
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
Are you using a get or a post for your form ?
 
priby mathew
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using POST for the form
 
Christophe Verré
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
I'm not sure of what will happen if you don't specify which encoding you are using for your file. There may be a better way to do it, but try this :
 
priby mathew
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Christopher,
I tried as you suggested and it s working now...

Thank you..


Regards,
Priby
 
reply
    Bookmark Topic Watch Topic
  • New Topic