// Hello world java file is utf-8
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World! 汉字!");
}
}
output as follows:
Hello World! 姹夊瓧锛�
but java file have the default code utf-8. and Debugger for java default also utf8, why the output is abnormal character!
Operating system : simplified Chinese win10 ; version. : 1709(16299 .334)
launch.json:
"configurations": [
{
"type": "java",
"name": "Java Debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "HelloWorld",
"encoding": "UTF-8",
"args": ""
},
……
// Hello world java file is utf-8
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World! 汉字!");
}
}
output as follows:
Hello World! 姹夊瓧锛�
but java file have the default code utf-8. and Debugger for java default also utf8, why the output is abnormal character!
Operating system : simplified Chinese win10 ; version. : 1709(16299 .334)
launch.json:
"configurations": [
{
"type": "java",
"name": "Java Debug",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopOnEntry": false,
"mainClass": "HelloWorld",
"encoding": "UTF-8",
"args": ""
},
……