duoduobingbing commented on issue #7116: URL: https://github.com/apache/netbeans/issues/7116#issuecomment-2028185022
@6PATyCb Thanks for testing. This proves that this is not a Font or `fontconfig.properties` (You can configure the font fallbacks for differing encodings there individually) The problem is that the output encoding of Netbeans does not match the output encoding of the Java project when running everything (Java and Netbeans) with the default output encoding. For Windows the default output encoding is always the native codepage. I can now reproduce this problem with the new launchers. It seems to make a difference whether you start `bin/netbeans.exe` or `bin/netbeans64.exe`. ### Netbeans started from `netbeans.exe` with everything on default When I start `bin/netbeans.exe` everything works correctly for me. The project's output encoding is `cp1252` and Netbeans output encoding also seems to be `cp1252` <img width="672" alt="nb1" src="https://github.com/apache/netbeans/assets/50800372/c96a2a8d-d9c9-461f-99e7-050df5f526b3"> Netbeans shows `Cp1252` in the about window and matches the Project's shown encoding `Cp1252` resulting in the expected `abcÄÖ✨️,Пример` => `abcÄÖ??,??????` where all characters not present in Cp1252 are turned into question marks. ### Netbeans started from `netbeans64.exe` with everything on default When I start `bin/netbeans64.exe` the output encodings become mismatched. The project's output encoding is `cp1252` and Netbeans output encoding seems to be `utf-8` <img width="701" alt="nb2" src="https://github.com/apache/netbeans/assets/50800372/99595422-1411-4153-854c-6251c23ecc7e"> Netbeans shows `UTF-8` in the about window and matches the Project's shown encoding `Cp1252` resulting in the unexpected `abcÄÖ✨️,Пример` => `abc⍰⍰??,??????` where all characters not present in Cp1252 are turned into question marks and all characters differently encoded from unicode but present in Cp1252 turn into Tofu characters. ### Workaround The reporter in [#7098](https://github.com/apache/netbeans/issues/7098) seemed to have the same issue. For now the best fix is to specify the encoding both on the project and inside `etc/netbeans.conf` to workaround those mismatches consistently. When setting the project's encoding explicitly to UTF-8 with `-Dfile.encoding=utf-8` and `-Dstdout.encoding=utf-8` and luckily we can also set the Netbeans output encoding explicitly with with `-J-Dstdout.encoding=utf-8` and `-J-Dfile.encoding=utf-8` inside `etc/netbeans.conf` so that everything works all time. It seems to be the same with Java 21: <img width="1276" alt="nb3" src="https://github.com/apache/netbeans/assets/50800372/3bafcd21-d491-4f75-a567-3fe3cefdfa8b"> This yields the expected `abcÄÖ✨️,Пример` because both Netbeans and the Projects output encoding is set `utf-8` --- <small>Note: On Java 21 the 'About' dialogue is not of much help to determine the output encoding of Netbeans because it seems to display `file.encoding` which on JDK 21 is `UTF-8` by default whereas `stdout.encoding` is still the native encoding e.g. `win1252`</small> -- 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
