#5 Internationalization isssues with encode function

open
nobody
None
5
2004-07-02
2004-07-02
Anonymous
No

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() +

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks