Eclipse中的Unicode字符 [英] Unicode characters in Eclipse

查看:141
本文介绍了Eclipse中的Unicode字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆