From bee07e96319719454df7eb780a7d0ae8a37a0370 Mon Sep 17 00:00:00 2001 From: Carlos Amengual Date: Sun, 15 Dec 2024 20:26:48 +0100 Subject: [PATCH] util: use a fixed locale in case conversion when retrieving the decoder factory --- .../io/sf/carte/echosvg/util/io/StreamNormalizingReader.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/echosvg-util/src/main/java/io/sf/carte/echosvg/util/io/StreamNormalizingReader.java b/echosvg-util/src/main/java/io/sf/carte/echosvg/util/io/StreamNormalizingReader.java index ebeddcf30..7208fab4a 100644 --- a/echosvg-util/src/main/java/io/sf/carte/echosvg/util/io/StreamNormalizingReader.java +++ b/echosvg-util/src/main/java/io/sf/carte/echosvg/util/io/StreamNormalizingReader.java @@ -22,6 +22,7 @@ import java.io.InputStream; import java.io.Reader; import java.util.HashMap; +import java.util.Locale; import java.util.Map; import io.sf.carte.echosvg.util.EncodingUtilities; @@ -157,7 +158,7 @@ public void close() throws IOException { * Creates the CharDecoder mapped with the given encoding name. */ protected CharDecoder createCharDecoder(InputStream is, String enc) throws IOException { - CharDecoderFactory cdf = charDecoderFactories.get(enc.toUpperCase()); + CharDecoderFactory cdf = charDecoderFactories.get(enc.toUpperCase(Locale.ROOT)); if (cdf != null) { return cdf.createCharDecoder(is); }