Windows-1252编码-显示不正确的字符 [英] Windows-1252 encoding - incorrect characters displayed

查看:692
本文介绍了Windows-1252编码-显示不正确的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有在Windows-1252中编码的字符的缓冲区。但是,当我使用适当的编码创建一个新的String时,而不是预期的结果,我经常会遇到询问标记。

I have a buffer with chars encoded in Windows-1252. However when I create a new String with appropriate encoding, instead of expected result I've get quite often interrogation marks, ex.

byte[] tmps = new byte[] {(byte) 0xfb};
System.out.println (new String (tmps,0,1,"Windows-1252" ));

因此,系统应在其上方显示 u字符和 ^。而是显示?。

As result the system should display "u" char with "^" above it. Instead it displays "?".

有什么想法吗?

推荐答案

我已经找到了。

菜单运行/运行配置/下一个Java应用程序和您自己的应用程序名称/标签公用/下一个编码设置为UTF-8

Menu Run/Run configurations/ next Java Application and your own app name/tab common/ next encoding set to UTF-8

从现在开始,Windows 1250和1252字符似乎都可以正常显示。

And since now both windows 1250 and 1252 chars seems to be displayed ok.

这篇关于Windows-1252编码-显示不正确的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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