Apache OpenOffice (AOO) Bugzilla – Issue 93769
Java based application not starting when special character in path
Last modified: 2009-03-20 11:27:26 UTC
- install OOo e.g. in c:\program files\büro\ - start File | Wizards | Letter - nothing happens - no Java based application will start in this case
My understanding always was that Java interprets file URLs in "system encoding" (what OOo calls osl_getThreadTextEncoding(); i.e., as "external" URLs in OOo's jargon). However, it appears that, at least on Windows, at least Java 5 and later, at least in certain cases interprets file URLs in UTF-8: The "ü" in the filepath being represented as MS1252 "%FC" causes the JNI call to ClassLoader.loadClass at stoc/source/javavm/javavm.cxx:1.78 l. 1769 to throw a java.lang.IllegalArgumentException at sun.net.www.ParseUtil.decode(ParseUtil.java:185) at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:563) at sun.misc.URLClassPath$3.run(URLClassPath.java:331) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath.getLoader(URLClassPath.java:320) at sun.misc.URLClassPath.getLoader(URLClassPath.java:297) at sun.misc.URLClassPath.getResource(URLClassPath.java:167) at java.net.URLClassLoader$1.run(URLClassLoader.java:192) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) where sun.net.www.ParseUtil.decode obviously expects UTF-8. This issue needs further investigation.
This is a possible duplicate of issue 95162.
*** Issue 95162 has been marked as a duplicate of this issue. ***
It appears that Java nowadays expects file URIs in UTF-8 (i.e., what OOo calls "internal" URIs) instead of locale-specific encoding (i.e., what OOo calls "external" URIs), see for example the section "Escaped octets, quotation, encoding, and decoding" of <http://java.sun.com/javase/6/docs/api/java/net/URI.html> and also <http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6522294>. That means that all places that map URIs between OOo and Java must no longer use com.sun.star.uri.ExternalUriReferenceTranslator to do so. Those places at least include tags/DEV300_m35/stoc/source/javavm/javavm.cxx@261996 l. 1640 and jvmaccess::ClassPath::translateToUrls in tags/DEV300_m35/jvmaccess/inc/jvmaccess/classpath.hxx@246305.
fixed as cws/sb103/jvmaccess/source/classpath.cxx@265468 cws/sb103/stoc/source/javavm/javavm.cxx@265468
@jsk: please verify
Verified, the wizard works even with umlauts and other stuff in the path.
Verified on MWS ooo310m6 for both Windows and Linux, closing