• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Chinese name in URL

 
aman bhatt
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From my first jsp I am selecting a Chinese pdf file and posting the first jsp to the second one.
In my second jsp when I am trying to fetch the File Name value from the field with request.getParameter("FileName") but I am getting a different junk value.
Though in my first jsp I have set, response.setCharatcerEncoding('UTF-8'). I am working on a windows environemnt and my app/Webserver server is Jboos-tomcat-apache.

Thanks,
aman
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18226
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never done chinese, but I don't think UTF-8 will work. Chinese requires 16-bit characters.
 
Paul Clapham
Sheriff
Posts: 21152
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
UTF-8 can represent all Unicode characters. Including Chinese.

Aman, I don't understand what "posting the first jsp to the second one" means. And you don't say whether the data in the first JSP is correct, or even where it is coming from. An explanation of where this string comes from and how it is transformed on its travels would help.
 
syd kahn
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using struts? if yuou are struts doesn't seem to get the utf characters correctly to the form bean - i had this problem...

http://www.coderanch.com/forums/
 
yang donf
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
before you post the form,you should encode the chinese characters into GB2312 or GBK
like this " string.getBytes("GBK",UTF-8); "
and in your second jsp file,you must encode it again,like this
"string.getBytes("UTF-8",GBK)
in the end,you should notice the HTML tag
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
it is hard to display correctly,because your page charset=ISO-8859-1
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic