Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Chinese Input

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what does the output source code look like?
 
lily zou
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
everything is normal except that the Chinese characters are all garbage. ( I used notepad to dipslay the html source code )
 
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic