From 1789debcd0075e21849d9c496d1947b1b7171c05 Mon Sep 17 00:00:00 2001 From: Jason Plumb Date: Fri, 20 Dec 2024 14:08:48 -0800 Subject: [PATCH] read lines with default encoding from os --- .../instrumentation/resources/ContainerResource.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java b/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java index db46fbb138cb..f323e99b253a 100644 --- a/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java +++ b/instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java @@ -10,6 +10,7 @@ import io.opentelemetry.api.common.Attributes; import io.opentelemetry.sdk.resources.Resource; import java.io.IOException; +import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.util.List; @@ -77,7 +78,7 @@ boolean isReadable(Path path) { @MustBeClosed Stream lines(Path path) throws IOException { - return Files.lines(path); + return Files.lines(path, Charset.defaultCharset()); } List lineList(Path path) throws IOException {