diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java index fa6e02545..f7db1cc7f 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/xhtml/XhtmlParser.java @@ -970,9 +970,9 @@ public class XhtmlParser { throw new FHIRFormatError("Invalid literal declaration following text: " + s); else if (c.charAt(0) == '#') { if (isInteger(c.substring(1), 10)) - s.append((char) Integer.parseInt(c.substring(1))); + s.append(Character.toString(Integer.parseInt(c.substring(1)))); else if (c.charAt(1) == 'x' && isInteger(c.substring(2), 16)) - s.append((char) Integer.parseInt(c.substring(2), 16)); + s.append(Character.toString(Integer.parseInt(c.substring(2), 16))); } else if (declaredEntities.containsKey(c)) { s.append(declaredEntities.get(c)); } else { diff --git a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java index 62f6ed1b4..114f087ce 100644 --- a/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java +++ b/org.hl7.fhir.utilities/src/test/java/org/hl7/fhir/utilities/tests/XhtmlNodeTest.java @@ -207,5 +207,17 @@ public class XhtmlNodeTest { Assertions.assertEquals("
This is a long paragraph