Unverified Commit 3b2d595a authored by skylot's avatar skylot Committed by GitHub

Merge pull request #255 from skylot/xml_unreadable_chars_escapes

Adds more escape for unreadable characters so parser won't throw exceptions during parse
parents b29223c5 d805ec15
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment