wood burning stoves 2.0*
The moose likes JSP and the fly likes Chinese name in URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Chinese name in URL" Watch "Chinese name in URL" New topic

Chinese name in URL

aman bhatt

Joined: Nov 11, 2005
Posts: 5
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.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15961

I've never done chinese, but I don't think UTF-8 will work. Chinese requires 16-bit characters.

Customer surveys are for companies who didn't pay proper attention to begin with.
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

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

Joined: Aug 23, 2005
Posts: 12
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...

yang donf

Joined: Nov 16, 2005
Posts: 3
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
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
I agree. Here's the link: http://aspose.com/file-tools
subject: Chinese name in URL
Similar Threads
Convert Chinese Name to english name in JSP page
problem with .properties file
How to store the Chinese character value in the Java.
input file element
Java internationalization question: Chinese file name display is grabbed in browser