4

我正在运行 Windows 7 并使用 python 脚本将一些阿拉伯语字符串输出到 Windows cmd。这就是我得到的:

在此处输入图像描述

如何正确配置 cmd 显示阿拉伯语字符串?

4

1 回答 1

10

Change your cmd's code page to the encoding you're outputting:

chcp 1256

That 1256 is an Arabic code page for Windows If you're outputting in another encoding, just find them in the whole list of code pages and change 1256 to the identifier you want in the command.

Hint: UTF-8 is 65001

Note: To show other characters than ascii, Window's cmd's current font must be changed to Lucida Console in properties. It's weird I know... Windows :)

Hope this helps!

于 2013-09-12T17:12:59.150 回答