Skip to content

Commit

Permalink
[7.4.0] Include sun.jnu.encoding in bazel info character-encoding
Browse files Browse the repository at this point in the history
… output (#23506)

The `sun.jnu.encoding` is what really determines the encoding used by
Java file system APIs (both .io and .nio) rather than `file.encoding`.
Making it more visible via an info item helps diagnose encoding bugs.

Closes #23469.

PiperOrigin-RevId: 670824910
Change-Id: Icba80b926b63090b0a5e5631e7aff673c9b71457

Commit
33ba589

Co-authored-by: Fabian Meumertzheim <fabian@meumertzhe.im>
  • Loading branch information
bazel-io and fmeum authored Sep 9, 2024
1 parent d8e0485 commit d85b972
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public byte[] get(
Supplier<BuildConfigurationValue> configurationSupplier, CommandEnvironment env) {
return print(
String.format(
"file.encoding = %s, defaultCharset = %s",
System.getProperty("file.encoding", "unknown"), Charset.defaultCharset().name()));
"file.encoding = %s, defaultCharset = %s, sun.jnu.encoding = %s",
System.getProperty("file.encoding", "unknown"),
Charset.defaultCharset().name(),
System.getProperty("sun.jnu.encoding", "unknown")));
}
}

0 comments on commit d85b972

Please sign in to comment.