Page 1 of 1

Uploading Chinese filenames [Solved]

Posted: Sun Jan 04, 2009 7:19 pm
by vlad
I'm using the premium version of JFileUpload and I'm trying to upload files with Chinese filenames (like 中文字符.txt). Although I've set the "encoding" PARAM to "UTF-8", the filename doesn't have the proper encoding when reaching the server. Also, the Chinese characters are not displayed properly in the upload log or the console log:

Uploading: ????.txt

[INFO] HTTPUploadTransfer - Upload (POST) started : C:\Users\x\Desktop\????\????.txt

Is Chinese included in the multilanguage support feature?

Thanks!

Re: Uploading Chinese filenames

Posted: Sun Jan 04, 2009 9:06 pm
by support
Chinese support should work as all others non-ascii languages. First make sure that the applet is able to display Chinese characters. To do so enable "resources" parameter such as:
<PARAM NAME="resources" VALUE="i18n">
And setup some Chinese words in i18n.properties (this file is under documentation/tutorials folder). All non-ascii values must be encoded in Unicode. See FAQ to convert your Chinese translated i18n.properties in Unicode:
http://www.jfileupload.com/products/jfi ... aq.html#19

If native2ascii program doesn't work for you then you can use the online Unicode helper:
http://unicode.org/cldr/utility/character.jsp?a=5B57 (5B57 is the Unicode for 字)

For instance, the first line of i18n.properties:
taskoutput.usage=Select or drag and drop file to upload
Would become:
taskoutput.usage=Select \u5B57 ...

Does it display the Chinese character in UI ?

Re: Uploading Chinese filenames

Posted: Mon Jan 05, 2009 10:15 am
by vlad
support wrote:Chinese support should work as all others non-ascii languages. First make sure that the applet is able to display Chinese characters. To do so enable "resources" parameter such as:
<PARAM NAME="resources" VALUE="i18n">
Although I have this parameter enabled, and I put "taskoutput.usage=Select \u5B57 ..." inside the "i18n.properties" file, the applet is not showing the Chinese character but an square sign.
Displaying Chinese characters in the UI is the least important issue, the serious problem is that the files uploaded trough the applet cannot keep their filenames (because they have Chinese characters).
This was a server-side problem. I now get the Chinese filenames properly.

Re: Uploading Chinese filenames

Posted: Mon Jan 05, 2009 10:06 pm
by support
I've just made a test and it displays the Chinese char. Which JRE version are you using ?

Re: Uploading Chinese filenames

Posted: Wed Jan 07, 2009 11:26 am
by vlad
I'm using Java version: 1.6.0_07
So I have this text: "Drag files from your computer here \u5B57 \u4E2D" which displays like this:
screenshot.gif
(868 Bytes) Downloaded 225 times

Re: Uploading Chinese filenames

Posted: Wed Jan 07, 2009 8:30 pm
by support
I did exactly the same and I have the following (see screenshot):
chinese.jpg
screenshot
(8.39 KiB) Downloaded 214 times
I'm wondering if you have a multi-languages JRE, could you try do install the latest one 1.6.0_11:
http://java.sun.com/javase/downloads/index.jsp

Or you could have a problem with the fonts in your JRE. Could you check you're able to see another applet with Chinese characters ?

Re: Uploading Chinese filenames

Posted: Thu Jan 15, 2009 1:44 pm
by vlad
It was a fonts issue. Thank you for your help!

Re: Uploading Chinese filenames [Solved]

Posted: Thu Jan 15, 2009 9:36 pm
by support
Great !

Re: Uploading Chinese filenames [Solved]

Posted: Wed Aug 22, 2012 11:30 am
by ravituvar
hi i am having the same issue with jFileUpload control..

I can upload the other files excepting having a chinese name..!

Please help me what should i do..?