Closed yuedaxia76 closed 5 months ago
Apache NetBeans 21 release candidate
System.out.println("中文a"); result is :中文a in netbeans 21 it is:����a
Even after setting set -J-Dfile.encoding=UTF-8 ,-J-Dfile.encoding=GBK ,there are still garbled characters
maven project
run 👍 public static void main(String[] argm) throws Exception { System.out.println(System.getProperty("file.encoding")); System.out.println(Charset.defaultCharset()); //System.setProperty("console.encoding", "UTF-8"); System.out.println("中文a"); System.setOut(new PrintStream(System.out,true,"UTF-8")); System.out.println("中文a");
}
Apache NetBeans 20
windows 10
test in 17、21
Apache NetBeans binary zip
No response
No
I user netbeans 21 release version.
You need to set stdout.encoding - see also #4771
stdout.encoding
set -J-Dstdout.encoding=GBK in netbeans.conf is ok 。 Old version ready to use out of the box, no need to set up。
Apache NetBeans version
Apache NetBeans 21 release candidate
What happened
System.out.println("中文a"); result is :中文a in netbeans 21 it is:����a
Even after setting set -J-Dfile.encoding=UTF-8 ,-J-Dfile.encoding=GBK ,there are still garbled characters
Language / Project Type / NetBeans Component
maven project
How to reproduce
run 👍 public static void main(String[] argm) throws Exception { System.out.println(System.getProperty("file.encoding")); System.out.println(Charset.defaultCharset()); //System.setProperty("console.encoding", "UTF-8"); System.out.println("中文a"); System.setOut(new PrintStream(System.out,true,"UTF-8")); System.out.println("中文a");
Did this work correctly in an earlier version?
Apache NetBeans 20
Operating System
windows 10
JDK
test in 17、21
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No