tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Create FileInputStream in servlet from remote file with accentuated character name
Date Tue, 22 Sep 2009 19:58:09 GMT
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:
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.
So let me ask a simple question :
- a file named "fichié.txt" has been created in a directory, by a 
process that spoke iso-8859-1 (so the filename is 10 bytes long).
- a Tomcat runs in a process whose locale is set to UTF-8, and an 
application inside this Tomcat reads the filename from the directory 
into a Java String variable S.
What happens ?
- does the application get an exception due to invalid encoding ?
- if not, why not ?
- if not, what is now the content, in bytes, of variable S ?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message