| Author |
download files with scandic letters
|
Deepan Ignatius
Ranch Hand
Joined: Mar 29, 2010
Posts: 41
|
|
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
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
|
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.
|
Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
|
 |
Deepan Ignatius
Ranch Hand
Joined: Mar 29, 2010
Posts: 41
|
|
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
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Deepan, please UseCodeTags next time. I've added them for you this time.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
Jesper de Jong
Java Cowboy
Bartender
Joined: Aug 16, 2005
Posts: 12953
|
|
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
Joined: Mar 29, 2010
Posts: 41
|
|
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
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Most consoles, including bash, tcsh and even Windows' command prompt, cannot handle much (if anything) that's not ASCII.
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
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 ?
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
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.
|
 |
 |
|
|
subject: download files with scandic letters
|
|
|