今天在写代码时突然发现控制台出现了中文乱码。
废话不多说,进入正题。
我的代码如下:
package test;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World! 意思是:你好,世界!");
}
}
运行后是:
Hello World! ��˼�ǣ���ã����磡
不难看出出现了乱码情况。
话不多说上解决方案。
/*eclipse 控制台(console) 出现中文乱码现象
* 解决方案:
* 右击 --->Run as--->Run Configurations--->Common--->Encoding--->other(输入)gbk--->Run*/
希望可以帮助到你。