Christopher, André,
Christopher Schultz a écrit :
And (just to anticipate the next issue), Sylvie, does your program
actually need to read the content of the file and do something with that
content ?
Yeah, remember to use a Reader and specify the character encoding.
Yes, my program
pouvons accepter aucune responsabilité
pour le contenu fourni.
Date: Thu, 24 Sep 2009 09:44:34 +0200
From: sylvie.per...@continew.fr
To: users@tomcat.apache.org
Subject: Re: Create FileInputStream in servlet from remote file with
accentuated character name
Christopher, André
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Martin,
On 9/24/2009 8:04 AM, Martin Gainty wrote:
implement the same charset that your CIFS drive is configured for
No filesystem that I know of has a standard encoding for file contents.
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG
Sylvie Perrin wrote:
Christopher, André,
Christopher Schultz a écrit :
And (just to anticipate the next issue), Sylvie, does your program
actually need to read the content of the file and do something with that
content ?
Yeah, remember to use a Reader and specify the character
Christopher Schultz wrote:
...
I dunno. This is pretty ugly. Again, setting everything to UTF-8
dramatically reduces headaches in these areas.
Thanks, Christopher.
I fully agree.
-
To unsubscribe, e-mail:
Christopher Schultz wrote:
...
What is the source of that file name? Is it hard-coded into your Java
code? If so, how? Did you just type fichié.txt into your .java file,
or did you use \uxyz syntax to specify the UNICODE character you intended?
If you are reading the filename from a remote
André,
I follow your tutorial and all outputs in Widows Explorer, DOS Command
Window and Linux Window are consistents concerning file names display.
For locale set under Linux, here is the output:
LANG=fr_FR.UTF-8
LC_CTYPE=fr_FR.UTF-8
LC_NUMERIC=fr_FR.UTF-8
LC_TIME=fr_FR.UTF-8
Sylvie Perrin wrote:
André,
I follow your tutorial and all outputs in Widows Explorer, DOS Command
Window and Linux Window are consistents concerning file names display.
That's good.
For locale set under Linux, here is the output:
LANG=fr_FR.UTF-8
LC_CTYPE=fr_FR.UTF-8
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
André,
On 9/22/2009 4:00 AM, André Warnier wrote:
what I am trying to say is that such matters are horrible, because
*everything* matters.
Eh.. well, yeah. :)
Your note about making sure, in the source code of the program, that the
filename is
André,
Thanks to you, my testcase is now running without any exception.
André Warnier a écrit :
Sylvie Perrin wrote:
I just remind that I have these lines in my tomcat auto-start script :
LC_ALL=fr_FR
export LC_ALL
Thuis, you should probably change, to be the same as your own locale
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Sylvie,
On 9/22/2009 11:01 AM, Sylvie Perrin wrote:
The cause was the LC_ALL variable in my script starting tomcat.
I set it to fr_FR.UTF-8 as you suggest and now, my test is OK !
I wonder if Java uses the file.encoding system property (which is
On 2009-09-22, at 11:33, Christopher Schultz ch...@christopherschultz.net
wrote:
Somebody needs to write a virus that just converts everything to UTF-8
so we can be done with it.
I hear you can contract out that sort of work these days. :-)
--
Len
Christopher Schultz wrote:
...
Then of course, after the above trivial matter of the filename is
resolved, one may have to tackle the matter of how the file contents are
encoded.
At least the programmer has some measure of control over that.
Not if she doesn't know what they have been
Sylvie Perrin wrote:
...
- your application, running (later) under Tomcat, is supposed to read
these files and do something with them.
I suppose that you do not know in advance, what the names of these
files will be, and you just have to take what is there. Is that correct ?
You perfectly
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
André,
On 9/22/2009 3:24 PM, André Warnier wrote:
Ok, then we need Christopher's Java knowledge now.
Or you could look at the API ;)
Christopher, how does one, in Java, read a directory item by item ?
See my other message on this thread which
Christopher Schultz wrote:
...
I wonder if Java uses the file.encoding system property (which is set by
the portion of $LC_ALL after the .) to convert bytes returned from the
filesystem into filenames and vice versa.
Yeah, that appears to be the case:
Christopher,
your detailed analysis is
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
André,
On 9/22/2009 3:58 PM, André Warnier wrote:
your detailed analysis is impressive and undoubtedly accurate, but
beyond what I can swallow right now in Java and after 2 glasses of
Spanish wine.
It's probably better than having 2 pints of
Christopher,
Here is the stack trace of the FileNotFoundException:
java.io.FileNotFoundException: /home/me/mountDir/fichi��.txt (No such
file or directory)
at java.io.FileInputStream.open(Native Method)
at
java.io.FileInputStream.init(FileInputStream.java:106)
at
Sylvie Perrin wrote:
Christopher,
Here is the stack trace of the FileNotFoundException:
java.io.FileNotFoundException: /home/me/mountDir/fichi��.txt (No such file or
directory)
Sylvie,
maybe what appears above shows the origin of the problem, and explains
what I was trying previously to
André,
Thank you for your help but I can't follow your main recommendation, ie.
avoid using non US-ASCII names.
Actually, file names are part of information my servlet have to process
and they cannot be changed.
I am not the owner of these names and I must deal with them.
Sylvie.
André
Sylvie,
I suggest you to create a mapping until you find a solution.
In your application, put the origianl file name as friendly name and save
the file without accent.
So, when user list the files, you show him the friendly name, but when you
load a file use the mapping entry to get the file
Sylvie Perrin wrote:
André,
Thank you for your help but I can't follow your main recommendation, ie.
avoid using non US-ASCII names.
Actually, file names are part of information my servlet have to process
and they cannot be changed.
I am not the owner of these names and I must deal with
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
André,
On 9/21/2009 5:45 AM, André Warnier wrote:
Sylvie Perrin wrote:
Christopher,
Here is the stack trace of the FileNotFoundException:
java.io.FileNotFoundException: /home/me/mountDir/fichi��.txt (No such
file or directory)
[snip]
Christopher,
Thank you for your help and see inline the results of the test you suggest.
It shows that sun.jnu.encoding hasn't got the same value in standalone
and servlet runs.
So, I change this property in the servlet test, by adding
JAVA_OPTS=-Dsun.jnu.encoding=UTF-8
in my Tomcat starting
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Sylvie,
On 9/18/2009 8:35 AM, Sylvie Perrin wrote:
So, I change this property in the servlet test, by adding
JAVA_OPTS=-Dsun.jnu.encoding=UTF-8
[snip]
But my issue is still here, ie. the FileNotFoundException.
I wonder if it has nothing to do
I have a problem with Tomcat 6.0 on Linux and I haven't been able to
determine the cause or solution.
I have a shared directory on a windows system named SHAREDDIR and
containing one file named fichié.txt
I mount this shared directory on my Linux system with the following command:
mount -t
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Sylvie,
On 9/17/2009 9:12 AM, Sylvie Perrin wrote:
I have a shared directory on a windows system named SHAREDDIR and
containing one file named fichié.txt
I mount this shared directory on my Linux system with the following
command:
mount -t cifs
Christopher Schultz wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Sylvie,
On 9/17/2009 9:12 AM, Sylvie Perrin wrote:
I have a shared directory on a windows system named SHAREDDIR and
containing one file named fichié.txt
Sylvie,
why do you not name your file fichier.txt, like it
28 matches
Mail list logo