[
https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17460529#comment-17460529
]
Aleksandr Dubinsky commented on NETBEANS-6298:
----------------------------------------------
It's so weird that Windows still doesn't use UTF-8 by default.
In any case, I suspect the problem is that Netbean's terminal is not using the
system _console_ encoding, while System.out is. In Java 17, this is exposed as
`java.io.Console.charset()` while in prior versions
`java.io.Console.encoding()` is a private method.
As a workaround, try setting the system properties `sun.stdout.encoding` and
`sun.stderr.encoding` to also be UTF-8 when launching Netbeans.
> About the garbled problem
> -------------------------
>
> Key: NETBEANS-6298
> URL: https://issues.apache.org/jira/browse/NETBEANS-6298
> Project: NetBeans
> Issue Type: Bug
> Components: cnd - Editor
> Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13
> Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project
> encoding UTF-8
> Reporter: luke
> Priority: Blocker
> Attachments: Garbled.gif, Garbled.png
>
>
> My Windows OS language is Simplified Chinese and the default OS encoding is
> GBK. When I open a properties file or a text file, the editor shows the file
> contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the
> editor opens the file in UTF-8 encoding format and the file is not garbled,
> but the console output is garbled.
> !Garbled.gif|width=1055,height=536!
> !Garbled.png|width=1542,height=843!
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
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