SOLVED Re: filenames with special characters

Rikard Froberg <[email protected]> Fri, 07 Jan 2005 17:26:56 +0100
Newsgroups gmane.comp.java.linux.general
Message-ID <[email protected]>
Rikard Froberg wrote:
> Hi,
> 
> We have upgraded from  Blackdown-1.3.1_02b-FCS
> (on debian stable)
> to
> Blackdown-1.4.2-01 on debian sarge.
> 
> After that, tomcat can't read files
> with accented characters (e.g. é, è, à etc)
> in their filenames, and also it can't read
> files with åäö (Swedish characters).
> 
> Java itself (running alone outside tomcat)
> handles this with
> 
> $ LANG=en_US java <class>
> (running on the command line) but tomcat
> seems to care less.
> 
> I know this might be a tomcat question,
> but cusious as I am, I investigated
> the way charsets is handled in 1.4, and
> found out about charsets.jar.
> 
> Looking in that archive, I found these:
> $ jar -tf /usr/lib/j2se/1.4/jre/lib/charsets.jar |grep ISO_8859_[0-9].class
> sun/nio/cs/ext/ISO_8859_3.class
> sun/nio/cs/ext/ISO_8859_6.class
> sun/nio/cs/ext/ISO_8859_8.class
> 
> but no ISO_8859_1. Why is that?
> (just out of curiosity).
> 
> On our test server, running
> Blackdown-1.3.1_02b-FCS (on woody)
> Java on the command line handles
> filenames with åäö (Swedish chars)
> and accented chars in the filename
> without the LANG= ploy.
> 
> What might be wrong/different?
> 
> Thanks in advance
> 
> Rikard
> 

This has now been solved by doing this:

First, start tomcat by changing catalina.sh,
the "start" section, by prepending the line
saying:
"$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS ...
so that it reads:
LC_CTYPE=en_US.ISO-8859-1 "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS ...

Than fixes the problem. It seems that Tomcat
cares only for LC_CTYPE and not LANG.

Strangely, it did not work to export LC_CTYPE within
catalina.sh, you had to set it on the line as above.

Restart tomcat, and it should work. At least it did for us.

It had nothing to do with charsets.jar, the class for
ISO-8859-1 resides in rt.jar.

Still don't know why all this changed from
previous versions.

Kind regards
Rikard


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]