Internationalization isssues with encode function
Brought to you by:
farrukh_najmi,
sethp
encode functions are not correctly serialize non-ASCII
characters.
There are 2 bugs:
1) "UTF-8" encoding is not used for any strings, so
resulting XML appears to be not valid.
Fix is to use
PrintStream out = null;
try {
out = new PrintStream
(output, false, "UTF-8");
} catch
(UnsupportedEncodingException e) {}
String indent = indenter.makeString();
out.println(indent + "<PolicySet PolicySetId=\"" +
getId().toASCIIString() +
2) anyURI type attributes are not encoded before
serialization. So they appears to be serialized with i18n
charecters not allowed in URI.
Fix is to use
out.println(indent + "<PolicySet PolicySetId=\"" +
getId().toASCIIString() +