anotherim/src/main/java/eu/siacs/conversations/utils/XmlHelper.java

14 lines
405 B
Java
Raw Normal View History

2014-10-22 16:38:44 +00:00
package eu.siacs.conversations.utils;
public class XmlHelper {
public static String encodeEntities(String content) {
content = content.replace("&", "&");
content = content.replace("<", "&lt;");
content = content.replace(">", "&gt;");
content = content.replace("\"", "&quot;");
content = content.replace("'", "&apos;");
content = content.replaceAll("\\p{Cc}", "");
2014-10-22 16:38:44 +00:00
return content;
}
}