From 58a933094fd5773f7c037f53b7d686ae6f9fa9bd Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Tue, 7 Mar 2023 06:30:01 +1100 Subject: [PATCH] fix json escaping --- .../src/main/java/org/hl7/fhir/utilities/Utilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index ed50e9ad6..4459a2525 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -996,7 +996,7 @@ public class Utilities { else if (c == ' ') b.append(" "); else if (isWhitespace(c)) { - b.append("\\u"+Integer.toHexString(c)); + b.append("\\u"+Utilities.padLeft(Integer.toHexString(c), '0', 4)); } else if (((int) c) < 32) b.append("\\u" + Utilities.padLeft(String.valueOf((int) c), '0', 4)); else