• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java internationalization question: Chinese file name display is grabbed in browser

 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I met an issue that when open a file with Chinese name in our application, the popup window ( see attachment) is not able to show Chinese Character, It shows "---" or " __" or "???" depends on diferent browser and OS (Windows and Linux).

The attachment is list the error popup window in IE8 (Chinese character is shown as __) and Firefox (Chinese character is shown as ---) in Windows. The Chinese character is shown as ??? in Firefox in Linux.

Also I tried to open the file from browser firefox and IE, we get the same popup window and it shows the Chinese Character OK.

So looks like the issue is related with file name encoding our product , I checked the file name before it is sent to browser, it is shown correctly as ChineseName, and encoding as UTF-8. I assume UTF-8 is right encoding we need to set for Chinese and am not sure what else I can check for the file name popup window

Any suggestions what else I need to check, or what other encoding I can use this case? (Same issue for Japanese file name)?

Thanks!




ChineseFileName.png
[Thumbnail for ChineseFileName.png]
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps the problem isn't in your application but in the operating system.
Can the browser display Chinese characters on regular web pages?
Can you create files on your file system with Chinese characters in the name?
 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried Windows and Linux, both are OK to display the Chinese Name File ; and also when I open the file with Chinese Name from firefox browser in Linux (not from my application), it pops up same window and shows Chinese File name correctly.

So Looks like the issue is only related with my application, but I am not sure where is the issue or where to debug it further.

Thanks

 
Steve Jiang
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The issue is similar in http://www.codeproject.com/KB/aspnet/NonUSASCII.aspx#Introduction, Display a non-US-ASCII filename in File Download dialog box

Since the above article is documented in 2004, and the no-aciiII file name is displayed correctly in windows with IE, firefox or chrome now. Do we still need to do the additional encoding for file name?

I tried add the encoding for file name as

fileName = URLEncoder.encode(fileName, "utf-8")

and get the different display for file name , like %3a38%3A24.xls. Should we do more encoding for the No-Ascii file name ?

Thanks



 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic