File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Chinese name in URL" Watch "Chinese name in URL" New topic
Author

Chinese name in URL

aman bhatt
Greenhorn

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.

Thanks,
aman
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

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
Bartender

Joined: Oct 14, 2005
Posts: 18121
    
    8

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

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...

http://www.coderanch.com/forums/
yang donf
Greenhorn

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
"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
 
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
Java internationalization question: Chinese file name display is grabbed in browser
How to store the Chinese character value in the Java.
problem with .properties file
input file element