| Author |
Accessing Japanese characters from text area
|
priby mathew
Greenhorn
Joined: Jan 28, 2008
Posts: 25
|
|
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
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
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 ]
|
[My Blog]
All roads lead to JavaRanch
|
 |
priby mathew
Greenhorn
Joined: Jan 28, 2008
Posts: 25
|
|
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
Joined: Nov 24, 2005
Posts: 14672
|
|
|
Are you using a get or a post for your form ?
|
 |
priby mathew
Greenhorn
Joined: Jan 28, 2008
Posts: 25
|
|
|
I am using POST for the form
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14672
|
|
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
Joined: Jan 28, 2008
Posts: 25
|
|
Hi Christopher, I tried as you suggested and it s working now... Thank you.. Regards, Priby
|
 |
 |
|
|
subject: Accessing Japanese characters from text area
|
|
|