I'm trying to create an XML file. The path I'm trying the create the file in have some writing in Hebrew so it get all messed up. I've tried to decode it with the URLDecoder but for some reason it doesn't seem to work.
The code:
String decoded = URLDecoder.decode(path, "UTF-8");
StreamResult file = new StreamResult(new File(decoded + "/reports.xml"));
transformer.transform(source, file);
The exception:
javax.xml.transform.TransformerException: java.io.FileNotFoundException: C:\Users\%D7%9C%D7%99%D7%9E%D7%95%D7%93%D7%99%D7%9D\JAVA\reports.xml (The system cannot find the path specified)
at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:297)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:330)
path = C:\Users\עבודה
The code works in any other directory which name is only in English.