diff --git a/projects/Lang/42/org/apache/commons/lang/Entities.java b/projects/Lang/42/org/apache/commons/lang/Entities.java index 900e1a8..0d8f7f4 100644 --- a/projects/Lang/42/org/apache/commons/lang/Entities.java +++ b/projects/Lang/42/org/apache/commons/lang/Entities.java @@ -825,10 +825,15 @@ public String escape(String str) { public void escape(Writer writer, String str) throws IOException { int len = str.length(); for (int i = 0; i < len; i++) { - char c = str.charAt(i); + int c = Character.codePointAt(str, i); String entityName = this.entityName(c); if (entityName == null) { - if (c > 0x7F) { + if (c >= 0x010000 && i < len - 1) { + writer.write("&#"); + writer.write(Integer.toString(c, 10)); + writer.write(';'); + i++; + } else if (c > 0x7F) { writer.write("&#"); writer.write(Integer.toString(c, 10)); writer.write(';');