【发布时间】:2011-01-07 11:33:40
【问题描述】:
我想要一个在 Windows 上支持 Unicode 的 shell。随附的 PowerShell 似乎没有。
PowerShell V2 (Windows 7 x64):
PS C:\> powershell
Windows PowerShell
Copyright (C) 2009 Microsoft Corporation. All rights reserved.
PS C:\> python
Python 2.6.2 (r262:71605, Apr 14 2009, 22:46:50) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> unicode_char=unichr(0xf12)
>>> unicode_char
u'\u0f12'
>>> print unicode_char
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\python26\lib\encodings\cp437.py", line 12, in encode
return codecs.charmap_encode(input,errors,encoding_map)
UnicodeEncodeError: 'charmap' codec can't encode character u'\u0f12' in position 0: character maps to <undefined>
>>>
我得到了与 PowerShell ISE 类似的结果,尽管网络上的某些地方声称它支持 Unicode 或其他什么...
Python 集成开发环境 (IDLE) 2.6.2 似乎运行良好:
>>> unicode_char=unichr(0xf12)
>>> print unicode_char
༒
>>>
IDLE 很慢,我更喜欢另一个 shell,有什么想法吗?我可以在 PowerShell 中完成这项工作吗?
【问题讨论】:
标签: python windows unicode powershell