File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

download files with scandic letters

 
Deepan Ignatius
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

My java program is writing contents to a excel file and naming it with scandic characters(äÄöÖåÅ). When the file is exported to a Windows machine I am able to view and download the same from my jsp. But when the file is exported to a Linux machine I am unable to view and download the same file. Is it something related with the encoding? Could you guys help me to resolve it?

Eg:- of a file name - "Kyä_1998_SB15.xls"

Thanks!
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's most likely a problem that has to do with character encodings. Can you please be more specific about what the problem is (describe it in more detail)? It might not even have anything to do with your program or with Java, but with the way you transfer those files from Windows to Linux or vice versa.
 
Deepan Ignatius
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code part(servlet):


--- creates an excel file and saves it in a Linux system.

File generated in Linux system is Anteron Oye2ää_1992570-8_CO3112201401.xls[but the original name generated in servlet is "Anteron Oye2ää_1992570-8_CO3112201401.xls"]

After this, I display the files generated in the Linux in my jsp[by listing the files present in the directory in the linux system] where it is listed properly like below

Anteron Oye2ää_1992570-8_CO3112201401.xls

and upon clicking the above link to download the file it is resulting an error. I tried to copy the shortcut for the above file(listed in my jsp) , the value present is

http://tsl8an01:4443/IcomsApp/DownloadFiles.jsp?FilePath=/u02/appdata/reports/ST/icoms/CommissionReport/Excel/&FileName=Anteron+Oye2%C3%A4%C3%A4_1992570-8_CO3112201401.xls

PS: when the name of the file doesn't have scandic characters I am able to download it from the same jsp.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepan, please UseCodeTags next time. I've added them for you this time.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please UseCodeTags when you post souce code - I added them to your post above.

Deepan Ignatius wrote:File generated in Linux system is Anteron Oye2ää_1992570-8_CO3112201401.xls[but the original name generated in servlet is "Anteron Oye2ää_1992570-8_CO3112201401.xls"]

Where and how do you see this? Are you logged in to the Linux box, and when you do "ls" in a terminal window, do you then see "Anteron Oye2ää..." or "Anteron Oye2ää..."?
 
Deepan Ignatius
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes. I am looging into the Linux box and seeing it as "Anteron Oye2ää..."

and it is working perfectly even with a unix box. The probelm is only when the reports are generated in the Linux machine.
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most consoles, including bash, tcsh and even Windows' command prompt, cannot handle much (if anything) that's not ASCII.
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rob Prime wrote:Deepan, please UseCodeTags next time. I've added them for you this time.

Jesper Young wrote:Please UseCodeTags when you post souce code - I added them to your post above.


Who is telling the truth ?
 
Rob Spoor
Sheriff
Pie
Posts: 20380
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both. We probably both pressed Edit for the original post, without code tags. I added them, updated (message was edited 1 time). Then a minute later Jesper, who was editing the original message, updated it (message was edited 2 times). Jesper's update essentially overwrote mine.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic