I have a problem where I cannot write accent files in a file name in Solaris.
Given the following code
public static void main(String[] args) {
System.out.println("Charset = "+ Charset.defaultCharset().toString());
System.out.println("testéörtkuoë");
FileWriter fw = null;
try {
fw = new FileWriter("testéörtkuoë");
fw.write("testéörtkuoëéörtkuoë");
fw.close();
I get the following output
Charset = ISO-8859-1
test??rtkuo?
and I get a file called "test ?? rtkuo?"
Based on the information I found on StackOverflow, I tried to invoke a Java application by adding "-Dfile.encoding = UTF-8" at startup. This returns the following result
Charset = UTF-8
testéörtkuoë
But the file name is still "test ?? rtkuo?"
Any help is greatly appreciated.
Stef
Stef
source
share