Jan K.: Tomcat: Umlaute falsch

Beitrag lesen

Hallo liebes Forum.

Ich brauche euren Rat, ich stehe auf dem Schlauch. Umlaute in einer Textdatei4 auf meinem Tomcat123 werden falsch angezeigt*5.

Hat jemand von euch eine Tipp für mich wie ich die Umlaute korrekt angezeigt bekomme, bzw. UTF-8 "einschalte"?

Gruß aus Berlin, Jan

*1 Systeminfo:

OS: Ubuntu 16.04 LTS 64Bit
Webserver: Tomcat 9
Java: JDK 8 64-Bit

*2 Relevante Environment-Variablen

declare -x CATALINA_OPTS="-Dfile.encoding=UTF-8"
declare -x JAVA_HOME="/opt/jdk1.8.0_101/"
declare -x JRE_HOME="/opt/jdk1.8.0_101/jre"
declare -x LANG="de_DE.UTF-8"
declare -x LANGUAGE="de_DE"
declare -x PATH="/opt/jdk1.8.0_101//bin:/opt/jdk1.8.0_101//bin:/opt/jdk1.8.0_101//bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

*3 URIEncoding in ..apache-tomcat-9.0.0.M11/conf/server.xml

<Connector port="8080" protocol="HTTP/1.1"
 URIEncoding="UTF-8"
 connectionTimeout="20000"
 redirectPort="8443" />

*4 Die problematische UTF-8-Datei

user@ubuntu:~/Downloads/apache-tomcat-9.0.0.M11/webapps/ROOT$ cat ./foo.txt
Ölsand
Oelsand
user@ubuntu:~/Downloads/apache-tomcat-9.0.0.M11/webapps/ROOT$ file ./foo.txt 
./foo.txt: UTF-8 Unicode text

*5 Das Egebnis: falsch angezeigte Umlaute

Umlaute werden falsch angezeigt

akzeptierte Antworten