duoduobingbing commented on PR #4321:
URL: https://github.com/apache/netbeans/pull/4321#issuecomment-1172957116

   @matthiasblaesing 
   > that is not in line with the default system encoding
   
   That is very easy to explain, If you have an application that displays 
output or takes input and you are using Windows it uses a Windows codepage by 
default. Let's say WIN1252.
   If you want to take in stuff that is not on the codepage you get garbled 
input and output as it will be converted to WIN1252.
   E.g. ✨✨✨ will become ✨✨✨. The only possible way to enter or display 
✨✨✨ is to use UTF-8 (or some other Unicode Encoding).
   
   Let's say you have an application that is executed with 
`-Dfile.encoding=utf-8` in Netbeans and have it output something like 
`System.out.println("日本語文書");`. Prior to Netbeans 14 it was possible to set the 
Netbeans output encoding to UTF-8 as well (via `file.encoding=utf-8` inside 
`netbeans.conf`) and the correct output `日本語文書` was displayed. Now the output 
encoding is set to `native.encoding` causing the output of garbled characters.
   
   > why does it work with windows CMD
   
   Please explain what you mean by that.
   
   > Why don't you change the encoding for the whole system?
   
   That, sadly, is not possible. You cannot simply set the system wide encoding 
in Windows to UTF-8.<br>
   See 
[this](https://superuser.com/questions/239810/setting-utf8-as-default-character-encoding-in-windows-7)
 for some additional context.
   
   > I don't like the usage of a new property, that noone apart from you will 
use.
   
   I asked in #4261 whether it would be possible to revert #3836 or if there is 
any other way, so that Windows users can switch their Netbeans back to UTF-8 
like they could prior to Netbeans 14. You did not reply, so I created this PR. 
I did not want to step on anyones toes regarding default behavior, so I just 
created an opt-in property, so that people who are forced to use Windows still 
have the option to get correct utf-8 output.


-- 
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

Reply via email to