UTF-8在Windows 7 CMD [英] UTF-8 in Windows 7 CMD

查看:175
本文介绍了UTF-8在Windows 7 CMD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在win7 cmd中显示UTF-8。目前,我使用标准字体,因为我看到mysql.exe,它工作正常与我正在处理的字符(目前德国umlautsßäöüÄÖÜ)。此外,对于另一种字体,相同的字符出现。

I've tried to display UTF-8 in the win7 cmd. Currently, I'm using the standard font because as I see with the mysql.exe, it works fine with the characters I'm working with (currently the german umlauts "ßäöüÄÖÜ"). Also, with another font, the same characters appear.

但是我的PHP脚本的输出显示垃圾,例如。 'Ÿ'for'ß'。当我管道输出到一个文件,并用Notepad ++打开它,它说编码是UTF-8。在php.ini中,我设置UTF-8作为编码以及连接到mySQL数据库,在数据库本身也设置为UTF-8。

But the output of my PHP script displays garbage, e.g. 'ß' for 'ß'. When I pipe the output into a file and open it up with Notepad++, it says the encoding is UTF-8. In php.ini I set UTF-8 as the encoding as well as in the connection to the mySQL database, and in the database itself UTF-8, too.

CMD我试图到目前为止将代码页设置为65001,但没有任何变化。

In CMD I tried so far to set the code page to 65001, but nothing changes.

编辑:我的PHP脚本保存为UTF-8以及

edit: my PHP script is saved as UTF-8 as well

似乎与latin1,我所需的字符可以显示太多,实际上它的工作原理。但是必须有一种方法在UTF-8中做它吗?我无法将所有内容转换为latin1

It seems with latin1, my desired characters can be displayed too and actually it works. But there has to be a way to do it in UTF-8? I can't convert everything to latin1

推荐答案

此问题已在 Windows命令行中的Unicode字符 - 如何?

您错过了一步 - >您需要使用Lucida控制台字体,除了从cmd控制台执行chcp 65001。

You missed one step -> you need to use Lucida console fonts in addition to executing chcp 65001 from cmd console.

这篇关于UTF-8在Windows 7 CMD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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