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 数据
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01