相关疑难解决方法(0)

cmd.exe使用什么编码/代码页?

当我在Windows中打开cmd.exe时,它使用的是什么编码?

如何查看当前使用的编码?它取决于我的区域设置还是有任何环境变量需要检查?

键入具有特定编码的文件时会发生什么?有时我会收到乱码(使用的编码不正确),有时候它会有所作为.但是,只要我不知道发生了什么,我就不相信任何事情.谁能解释一下?

windows encoding command-line

258
推荐指数
5
解决办法
23万
查看次数

为什么Windows上的python 2.7在打印时需要一个空格才能打开unicode字符?

我使用cmd Windows,chcp 65001,这是我的代码:

print u'\u0110 \u0110' + '\n'
Run Code Online (Sandbox Code Playgroud)

结果:

 (a character cmd can't display) (character what i want)
 Traceback (most recent call last):
      File "b.py", line 26, in <module>
        print u'\u0110 \u0110'
    IOError: [Errno 2] No such file or directory
Run Code Online (Sandbox Code Playgroud)

但是,当我使用这段代码时:

print u' \u0110 \u0110' + '\n'
Run Code Online (Sandbox Code Playgroud)

结果:

(a space)(charecter what i want) (character what i want)
Traceback (most recent call last):
  File "b.py", line 26, in <module>
    print u' \u0110 \u0110' + '\n'
IOError: [Errno 2] No such file …
Run Code Online (Sandbox Code Playgroud)

python unicode python-2.7

6
推荐指数
2
解决办法
1150
查看次数

标签 统计

command-line ×1

encoding ×1

python ×1

python-2.7 ×1

unicode ×1

windows ×1