You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sis.apache.org by de...@apache.org on 2026/10/16 23:31:55 UTC
(sis) 03/05: Fix a wrong encoding in logging property files. That particular case is fixed to ISO-LATIN-1.
This is an automated email from the ASF dual-hosted git repository.
asf-gitbox-commits pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git
commit c12db320713549979ab23cbb6a316e1083093924
Author: Martin Desruisseaux <ma...@geomatys.com>
AuthorDate: Fri Oct 16 15:54:22 2026 +0200
Fix a wrong encoding in logging property files.
That particular case is fixed to ISO-LATIN-1.
---
.../main/org/apache/sis/util/logging/Initializer.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/logging/Initializer.java b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/logging/Initializer.java
index 5c2f11e9d8..f7a02b025a 100644
--- a/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/logging/Initializer.java
+++ b/endorsed/src/org.apache.sis.util/main/org/apache/sis/util/logging/Initializer.java
@@ -22,6 +22,7 @@ import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.File;
+import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -131,7 +132,7 @@ public class Initializer {
*/
public static void reload(Path path) throws IOException {
path = path.normalize();
- final StringBuilder buffer = new StringBuilder(600);
+ final var buffer = new StringBuilder(600);
for (String line : Files.readAllLines(path)) {
if (!(line = line.trim()).isEmpty() && line.charAt(0) != '#') {
final int base = buffer.length();
@@ -140,7 +141,7 @@ public class Initializer {
final int i = buffer.indexOf(PATTERN, base + PATTERN_PROPERTY.length());
if (i >= 0) {
Path parent = path;
- for (int j=Math.min(parent.getNameCount(), 2); --j >= 0;) {
+ for (int j = Math.min(parent.getNameCount(), 2); --j >= 0;) {
parent = parent.getParent();
}
String replacement = (parent != null) ? parent.toString() : ".";
@@ -150,6 +151,7 @@ public class Initializer {
}
}
}
- LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(buffer.toString().getBytes()));
+ LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(
+ buffer.toString().getBytes(StandardCharsets.ISO_8859_1)));
}
}