duoduobingbing commented on issue #4261: URL: https://github.com/apache/netbeans/issues/4261#issuecomment-1161917579
I've investigated this further and found the culprit. It's because of [PR#3863](https://github.com/apache/netbeans/pull/3836). Printing out ``` System.out.println(Charset.defaultCharset()); System.out.println(System.getProperty("file.encoding")); System.out.println(System.getProperty("native.encoding")); System.out.println(System.getProperty("sun.jnu.encoding")); ``` got the answer. This got me the following results for JDK18 and JDK17: ``` UTF-8 UTF-8 Cp1252 Cp1252 ``` Setting `native.encoding` via `-Dnative.encoding=utf-8` under Windows does not change the value that is obtainable via `System.getProperty("native.encoding")`. It always reflects the output of `sun.jnu.encoding` which is also not changeable via java command line under Windows. PR#3863 incorrectly assumes that `native.encoding` is `null` when not set explicitly, which its not true under Windows. Neither for JDK17 nor JDK18. So under Windows Netbeans just uses `sun.jnu.encoding` regardless of configuration for the output window which is for my machine always Windows1252. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
