Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-24 Thread André Warnier
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 encoding

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-24 Thread Christopher Schultz
-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 v1.4

RE: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-24 Thread Martin Gainty
ets à la manipulation, nous ne 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 > accen

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-24 Thread Sylvie Perrin
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 n

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-23 Thread André Warnier
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: users-unsubscr...@to

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Christopher Schultz
-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 Be

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread André Warnier
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 im

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Christopher Schultz
-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 i

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread André Warnier
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 und

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread André Warnier
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 creat

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Len Popp
On 2009-09-22, at 11:33, Christopher Schultz > 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 - T

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Christopher Schultz
-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

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Sylvie Perrin
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 fr_FR.UT

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Christopher Schultz
-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

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread André Warnier
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" LC_NUMERIC="fr_FR

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread Sylvie Perrin
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" LC_COLL

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-22 Thread André Warnier
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

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-21 Thread Christopher Schultz
-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) [sn

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-21 Thread André Warnier
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 the

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-21 Thread ramzi khlil
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 name

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-21 Thread Sylvie Perrin
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é War

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-21 Thread André Warnier
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 tel

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-21 Thread Sylvie Perrin
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.(FileInputStream.java:106)     at SambaMoun

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-18 Thread Christopher Schultz
-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

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-18 Thread Sylvie Perrin
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

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-17 Thread André Warnier
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 sh

Re: Create FileInputStream in servlet from remote file with accentuated character name

2009-09-17 Thread Christopher Schultz
-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 -

Create FileInputStream in servlet from remote file with accentuated character name

2009-09-17 Thread Sylvie Perrin
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