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 编写 Fortran 无格式文件 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
