Eclipse中的Unicode字符 [英] Unicode characters in Eclipse
问题描述
System.out.println(\\) \☯); Netbeans中的一切都是可以的(默认设置):阴阳和其他英文的东西都是打印出来的正确。我该怎么做,使Eclipse做同样的事情?使用默认的Eclipse设置,我只得到?。
我尝试在运行对话框中更改控制台编码,如
,但事情变得更糟(更确切地说,这是输出:剅䐍琅瀡ഊⴱⴱⴱഊ奅䱌佗ഊ楴ഊ〠ഊഊ㼍ੇ剅䕎ഊ奯甠捡渠杯ഊ〠ഊഊ㼍 - 哪一个是阴阳??)。
任何建议? / p>
解决方案在日食中,为我打印ying-yang
System.out.println(new String(Character.toChars(9775)));
转到窗口 - >首选项 - >常规 - >工作区 - > TextFileEncoding,将其设置为UTF- 8
I'm trying to print nice yin-yang from my Java program:
System.out.println("\u262f");
Everything is OK in Netbeans (default settings): both yin-yang and other stuff in English is printed correctly. What should I do to make Eclipse to do the same? With default Eclipse setting I get only "?".
I tried to change Console Encoding in Run Dialog like suggested in
extracting unicode text from mysql to java, but things get even worse (more precisely, this is output: 剅䐍瑯瀡ഊⴱਿഊ奅䱌佗ഊ坡楴ഊ〠ഊഊ㼍ੇ剅䕎ഊ奯甠捡渠杯ഊ〠ഊഊ㼍� - which one is yin-yang??).
Any suggestions?
解决方案 In eclipse this prints the ying-yang for me
System.out.println(new String(Character.toChars(9775)));
Go to Window->Preferences->General->Workspace->TextFileEncoding, set it to UTF-8
这篇关于Eclipse中的Unicode字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!