我的配置:Win7 + Python 2.6 + eclipse + PyDev
My configuration: Win7 + Python 2.6 + eclipse + PyDev
如何在以下位置启用 Unicode 打印语句:
How do I enable Unicode print statements in:
打印语句示例:
print(u"שלום עולם")
结果如下:
ùìåí òåìí
对于 eclipse unicode 控制台支持:
For eclipse unicode console support:
-Dfile.encoding=UTF-8 添加到 eclipse 安装目录中的 eclipse.ini 中.RunRun ConfigurationsPython RunconfigurationCommon 确保选择了 UTF-8WindowPreferencesGeneralWorkspaceText 文件编码 确保选择了 UTF-8[python 安装路径]Libsite.py - 从 encoding = "ascii" 更改为 encoding = "utf-8"代码>WindowPreferencesAppearanceColors and FontsDebugConsole fontEdit-Dfile.encoding=UTF-8 to eclipse.ini which is in the eclipse install directory.RunRun ConfigurationsPython RunconfigurationCommon make sure UTF-8 is selectedWindowPreferencesGeneralWorkspaceText file encoding making sure UTF-8 is selected[python install path]Libsite.py - change from encoding = "ascii" to encoding = "utf-8"WindowPreferencesAppearanceColors and FontsDebugConsole fontEdit在安装过程中,我完成了上述所有操作:
In the installation I did all of the above:
print(u"שלום עולם") # Doesn't work
print("שלום עולם") # Works
对于 django 模型:
For django models:
print(my_model.my_field) # Doesn't work
print(my_model.my_field.encode('utf-8')) # Works
这篇关于在 Eclipse Pydev 控制台和 Idle 中打印 Unicode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Eclipse 的 Visual Studio Ctrl+Tab 和 Ctrl+Shift+Tab 等效项Eclipse#39;s Visual Studio Ctrl+Tab and Ctrl+Shift+Tab Equivalent(Eclipse 的 Visual Studio Ctrl+Tab 和 Ctrl+Shift+Tab 等效项)
如何防止 Eclipse 在包资源管理器中显示打开的文How to prevent Eclipse from showing the opened file in package explorer(如何防止 Eclipse 在包资源管理器中显示打开的文件)
XML 解析器返回意外的令牌错误和空指针异常XML Parser Returning unexpected token error and null pointer exception(XML 解析器返回意外的令牌错误和空指针异常)
Java 解析 XML 文档给出“Prolog 中不允许的内容&qJava parsing XML document gives quot;Content not allowed in prolog.quot; error(Java 解析 XML 文档给出“Prolog 中不允许的内容.错误)
如何在 Eclipse 中将源附加到 Google Drive API 或“AHow to attach source to Google Drive API or `Android Private Library` in Eclipse(如何在 Eclipse 中将源附加到 Google Drive API 或“Android Pr
Lint:如何忽略“<key>"未翻译成&Lint: How to ignore quot;lt;keygt; is not translated in lt;languagegt;quot; errors?(Lint:如何忽略“lt;keygt;未翻译成lt;语言gt;错误?)