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:
@@ -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 "&";
|
||||
@@ -160,6 +163,8 @@ public class StringUtils {
|
||||
return """;
|
||||
case '\'':
|
||||
return "'";
|
||||
case '\\':
|
||||
return "\\\\";
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user