-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
为解决GBK环境的输出乱码问题,尝试https://stackoverflow.com/questions/3017695/how-to-… #12
base: master
Are you sure you want to change the base?
Conversation
@azige 我之前在linux下试了好像没有用 (也把系统设为GBK). 不过症状不大一样. 你好像还有些字符能显示, 我是全都乱码. 不知有没有空试试中文windows? |
似乎没有效果,我把 |
@azige 继续研究中。确认一下,除了这一处还有其他位置有乱码吗?我在Ubuntu14.04里用
如果你也是的话,应该就不是这个checkstyle插件特有的问题了。 |
你试试看在那个环境下 这个问题修不好的话就暂时放置吧,毕竟影响不大而且本人这边也有替代方案 |
虽然不一定能搞定这个问题(找到根源), 不过还是想明白乱码的直接原因。。。
输出是
第二个可以解释GBK编码的控制台输出了UTF8格式的字符串,但是解释不了UTF8编码的控制台为啥还是输出了部分乱码(��?始检查�?��??) |
初步分析: GBK格式输出
GBK码是双字节, 总体编码范围为 8140-FEFE, 首字节在 81-FE 之间(来源). 因此80不是合法GBK码, 显示为 更关键的问题: UTF8格式输出
至于为何在转成GBK字符时置为了
另外, 在转格式时, 字节数组的分段方式. 从上面两个表看, 好像是简单的从左到右最小匹配. |
不知道有没有用?