From 8d24863c80109384c0b34e410ae3ca010f1ba825 Mon Sep 17 00:00:00 2001 From: James Cover jdcove2 Date: Mon, 4 Nov 2024 15:36:22 +0000 Subject: [PATCH] Minor type cleanup. --- src/main/java/emissary/core/IBaseDataObjectXmlCodecs.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/emissary/core/IBaseDataObjectXmlCodecs.java b/src/main/java/emissary/core/IBaseDataObjectXmlCodecs.java index 89686078b0..bccc3449f4 100644 --- a/src/main/java/emissary/core/IBaseDataObjectXmlCodecs.java +++ b/src/main/java/emissary/core/IBaseDataObjectXmlCodecs.java @@ -845,8 +845,10 @@ public static boolean requiresEncoding(final byte[] utf8Bytes) { // https://stackoverflow.com/questions/3770117/what-is-the-range-of-unicode-printable-characters public static boolean requiresEncoding(final Reader reader) throws IOException { try (BufferedReader bufferedReader = new BufferedReader(reader)) { - int c; - while ((c = bufferedReader.read()) >= 0) { + int i; + while ((i = bufferedReader.read()) != -1) { + final char c = (char) i; + if (('\u0000' <= c && c <= '\u0008') || ('\u000E' <= c && c <= '\u001F') || ('\u007F' <= c && c <= '\u009F') ||