powered by Jive Software

StringUtils.escapeForXML to escape single quote

This tiny little patch adds escaping of single quote character (’) into ’ in source/org/jivesoftware/smack/util/StringUtils.java.

The code:

String data = “It’s a good day today”;

StringBuilder b = new StringBuilder();

b.append("");

will now generate the string: instead of the faulty <element data=‘It’s a good day today’/>.

Jonas
stringutils.patch (1265 Bytes)