Windows 7 CMD中的UTF-8 [英] UTF-8 in Windows 7 CMD

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

问题描述

我试图在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脚本的输出显示垃圾,例如'Ã''为'ß'。当我将输出管道输入文件并用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.

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

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