Topic
  • 2 replies
  • Latest Post - ‏2012-02-16T05:10:23Z by SystemAdmin
Munagala
Munagala
1 Post

Pinned topic how to pass chinese charatered string in a Java Method

‏2011-02-21T11:42:18Z |
Funtionality Desired:
When user clicked on the file named hyperlink ( which is now displaying in the chinese characterd file name in web page).
That file name need to passed to a method, which has to fetch the file and give the user to download.

Problem:
When i try to pass chinese (non-english characterd) string as a file name to a Java method. It is not working..
How to pass non-english string values to a java method..

I tried several ways likes:
Option:1:
filenamepassed = URLEncoder.encode(filenamepassed, "UTF-8");
String decodedfilename= URLDecoder.decode(filenamepassed);

Option:2:
Setting file.encoding="UTF-8"

I am unable to solve the issue.
Thanks in advance for helping in this regard.
Updated on 2012-02-16T05:10:23Z at 2012-02-16T05:10:23Z by SystemAdmin
  • nishchal
    nishchal
    2 Posts

    Re: how to pass chinese charatered string in a Java Method

    ‏2011-04-29T07:03:08Z  
    Try to handle by JS.
  • SystemAdmin
    SystemAdmin
    4447 Posts

    Re: how to pass chinese charatered string in a Java Method

    ‏2012-02-16T05:10:23Z  
    Maybe you can try to use the BASE64 encoder.
    For example, encode the chinese word like this .%E5%93%88%E5%93%88
    Many chinese website use base64 encode the chinese word.
    Maybe it will help. :)