Monkey with JarUrlConnection to make it work when LANG unset
The problem all along has been in AsciiBytes, so the fix in commit ce3aaf was just a stop gap for a system where multi-byte characters are supported but the default encoding is not UTF-8 (e.g. most Windows systems). The real solution is not to leave it to chance and always pick an encoding for the JarEntry names (i.e. in AsciiBytes). Fixes gh-764
This commit is contained in:
@@ -91,6 +91,8 @@ public class JarFileTests {
|
||||
URLClassLoader urlClassLoader = new URLClassLoader(new URL[] { jarUrl });
|
||||
assertThat(urlClassLoader.getResource("special/\u00EB.dat"), notNullValue());
|
||||
assertThat(urlClassLoader.getResource("d/9.dat"), notNullValue());
|
||||
jarFile.close();
|
||||
urlClassLoader.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -133,6 +135,7 @@ public class JarFileTests {
|
||||
URLClassLoader urlClassLoader = new URLClassLoader(
|
||||
new URL[] { this.jarFile.getUrl() });
|
||||
assertThat(urlClassLoader.getResource("special/\u00EB.dat"), notNullValue());
|
||||
urlClassLoader.close();
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -365,5 +368,6 @@ public class JarFileTests {
|
||||
jarEntry.getCertificates());
|
||||
}
|
||||
}
|
||||
jarFile.close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user