How to get PyCharm to display unicode data in its console?(如何让 PyCharm 在其控制台中显示 unicode 数据?)
问题描述
我已经切换到 PyCharm 并且使用它时玩得很开心.我为使用英语以外的语言(即希伯来语和阿拉伯语)的项目编写代码,并且需要不时调试编码.出于某种原因,PyCharm 不会在其调试控制台中显示 Unicode 字符.
I have switched over to PyCharm and have had a blast using it. I code for projects that use languages other than English (i.e. Hebrew and Arabic) and need to debug encodings once in a while. For some reason, PyCharm will not display Unicode characters in its debug console.
我已将 IDE 编码设置为 UTF-8,但没有帮助.
I have set the IDE encoding to UTF-8 but it did not help.
有什么想法吗?
推荐答案
接受的答案不再正确.在默认字体中,它们都没有区别.我刚刚解决了同样的问题,最好的解决方案是修改您的 .bash_profile(或 .zshrc)并包含以下行:
The accepted answer is no longer correct. Of the default fonts, none of them make a difference. I just spent awhile going through this same problem and the best solution is to modify your .bash_profile (or .zshrc) and include the line:
export PYTHONIOENCODING=UTF-8
理论上,您也可以将其添加到您可以在 Preferences->Build,Execution,Deployment->Python Console 中设置的环境变量中然而,这种方法似乎在我正在使用的构建中被打破了(4.0.4)
In theory, you could also add this to your Environment Variables which you can set from within Preferences->Build,Execution,Deployment->Python Console This approach, however, seems to be broken in the build I am using (4.0.4)
这篇关于如何让 PyCharm 在其控制台中显示 unicode 数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何让 PyCharm 在其控制台中显示 unicode 数据


基础教程推荐
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- 对多索引数据帧的列进行排序 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01