Uploading Chinese filenames [Solved]

Upload core product.
Post Reply
vlad
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Uploading Chinese filenames [Solved]

Post 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!
Last edited by vlad on Thu Jan 15, 2009 1:45 pm, edited 1 time in total.

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Uploading Chinese filenames

Post 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 ?

vlad
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Uploading Chinese filenames

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

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Uploading Chinese filenames

Post by support »

I've just made a test and it displays the Chinese char. Which JRE version are you using ?

vlad
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Uploading Chinese filenames

Post 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

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Uploading Chinese filenames

Post 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 ?

vlad
Posts: 82
Joined: Sun Jan 04, 2009 6:38 pm

Re: Uploading Chinese filenames

Post by vlad »

It was a fonts issue. Thank you for your help!

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Uploading Chinese filenames [Solved]

Post by support »

Great !

ravituvar
Posts: 7
Joined: Wed Aug 22, 2012 11:28 am
Location: Ahmedabad
Contact:

Re: Uploading Chinese filenames [Solved]

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

Post Reply