Merge pull request #255 from skylot/xml_unreadable_chars_escapes

Adds more escape for unreadable characters so parser won't throw exceptions during parse
This commit is contained in:
skylot
2018-04-14 15:23:02 +03:00
committed by GitHub
@@ -149,6 +149,9 @@ public class StringUtils {
}
private static String escapeXmlChar(char c) {
if(c >= 0 && c <= 0x1F) {
return "\\" + (int) c;
}
switch (c) {
case '&':
return "&amp;";
@@ -160,6 +163,8 @@ public class StringUtils {
return "&quot;";
case '\'':
return "&apos;";
case '\\':
return "\\\\";
default:
return null;
}