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 数据
基础教程推荐
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 包装空间模型 2022-01-01
- 求两个直方图的卷积 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
