I'm trying to update a application, running mainly on Mac OSX, from Java6 to Java7. It occurs that files beeing creating with some special characters in the filename e.g. "föhn.txt" are beeing created as "f?hn.txt" with Java7.
If you run this sort example on a Mac
File file = new File("föhn.txt");
file.createNewFile();
- with Java6: föhn.txt
- with Java7: f?hn.txt
I know there're simular threads for this topic:
and I've tryed to set JVM argument: -Dfile.encoding=UTF8
but this has no effect to the filename. Compiler and source are set to utf-8. I've no idea why this is not working with Java7 on OS X.
Update: I've tried the example within eclipse and Netbeans and the final application is bundled with the jdk (appbundler).
Mac OS X uses a decomposed UTF-8 format: File.listFiles() mangles unicode names with JDK 6 (Unicode Normalization issues)
And a blog about this topic: http://shlrm.org/blog/2012/10/04/osx-java-utf-8-oh-my/
This helps reading filenames but I've not found a solution for creating new files with the correct encoded filename.