Skip to content

Commit 824da70

Browse files
Read file lines in the system default charset.
* Ensure that Files.lines(Path) reads filesystem files in the charset of the underlying operating system and not UTF-8. Signed-off-by: Alex Brown <[email protected]>
1 parent 2edd778 commit 824da70

File tree

1 file changed

+2
-1
lines changed
  • instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources

1 file changed

+2
-1
lines changed

instrumentation/resources/library/src/main/java/io/opentelemetry/instrumentation/resources/ContainerResource.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import io.opentelemetry.api.common.Attributes;
1111
import io.opentelemetry.sdk.resources.Resource;
1212
import java.io.IOException;
13+
import java.nio.charset.Charset;
1314
import java.nio.file.Files;
1415
import java.nio.file.Path;
1516
import java.util.List;
@@ -77,7 +78,7 @@ boolean isReadable(Path path) {
7778

7879
@MustBeClosed
7980
Stream<String> lines(Path path) throws IOException {
80-
return Files.lines(path);
81+
return Files.lines(path, Charset.defaultCharset());
8182
}
8283

8384
List<String> lineList(Path path) throws IOException {

0 commit comments

Comments
 (0)