From 9df3a181b1d3c53a844d9c2cf5fb577da26152cd Mon Sep 17 00:00:00 2001 From: "Steven R. Loomis" Date: Mon, 23 Oct 2023 15:40:26 -0500 Subject: [PATCH] CLDR-17171 v44 JSON: don't emit {} for space replacement (#3358) Punt a better fix to CLDR-17186 --- .../java/org/unicode/cldr/json/Ldml2JsonConverter.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java index 978a277afbf..32bf5429df7 100644 --- a/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java +++ b/tools/cldr-code/src/main/java/org/unicode/cldr/json/Ldml2JsonConverter.java @@ -2264,9 +2264,16 @@ private void writeLeafNode( // out.name(objName); if (value.isEmpty()) { if (valueIsSpacesepArray) { + // empty value, output as empty space-sep array: [] out.getAsJsonObject().add(objName, new JsonArray()); } else { - out.getAsJsonObject().add(objName, new JsonObject()); + // empty value. + if (objName.endsWith("SpaceReplacement")) { // foreignSpaceReplacement or + // nativeSpaceReplacement + out.getAsJsonObject().addProperty(objName, ""); + } else { + out.getAsJsonObject().add(objName, new JsonObject()); + } } } else if (type == RunType.annotations || type == RunType.annotationsDerived) { JsonArray a = new JsonArray();