The moose likes HTML, CSS and JavaScript and the fly likes Chinese Input Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Chinese Input " Watch "Chinese Input " New topic
Author

Chinese Input

lily zou
Ranch Hand

Joined: Jan 15, 2002
Posts: 50
Hi, there
If I have a form which has a input field where I want to input Chinese characters and submit to a servlet. The servlet will process the characters and display them again. While the html file where the form sits has set charset to be utf-8 and my browser encode type is utf-8 as well, I always got wrong Chinese characters output.
May I ask what kind of input I should use ? unicode like "\u433c" or any other format ?
Thanks a lot.
Lily
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
People have complained about this before with the problems of unicode characters.
One thing is the output have the right type of font available and in use it whcih has these characters? That is a common problem.
If not, I will look into other causes of it for you.
Eric
lily zou
Ranch Hand

Joined: Jan 15, 2002
Posts: 50
Thanks,Eric
The things is that I am not quite sure if the output is the right font. If I check Google site, I input Chinese text in search and submit, the input field will contain the right Chinese text I just input. Also, if I check the web page's source code, all the Chinese text is correctly displayed.
However, in my page, the returned input field will contain wrong Chinese text and the source code I viewed also contains something which cann't be recognized instead of Chinese.
I used some tool to generate Chinese and paste to those input fields. Also , I am using Tomcat4 as my web server.
Lily
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15003
what does the output source code look like?
lily zou
Ranch Hand

Joined: Jan 15, 2002
Posts: 50
everything is normal except that the Chinese characters are all garbage. ( I used notepad to dipslay the html source code )
 
 
subject: Chinese Input
 
Threads others viewed
setting utf-8 in jsp
Reading a UTF-8 file & Writing it to a UTF-8 file
Help to retrieve Chinese characters from MS Access
Chinese name in URL
UTF-8 Character issue while doing request.getParameter in servlet
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture