【问题标题】:Unexpected Python Printing Unicode Output意外的 Python 打印 Unicode 输出
【发布时间】:2020-08-31 15:38:13
【问题描述】:
print("✨ ???? ✨")

上面的代码打印出来

✨ �????✨✨

我无法理解发生�和额外✨的原因。 有人,请解释为什么会发生这种情况以及我怎么能得到✨ ???? ✨作为输出。谢谢!

环境:

Windows 10 ver. 1909 
Python 3.8.3 
MSVSC 1.47.3

【问题讨论】:

  • 对我来说很好用(Python 3.6.9,Linux)
  • 我认为它完全取决于我用 cmd 尝试过的 cli,当我尝试使用 VScode 时,我得到了一些带有问号的正方形,它工作正常

标签: python python-3.x unicode python-unicode unicode-string


【解决方案1】:

这也发生在我的机器上。作为一种解决方法,使用图标的chr() 而不是复制粘贴它们

【讨论】:

    猜你喜欢
    • 2016-04-03
    • 2020-07-20
    • 1970-01-01
    • 1970-01-01
    • 2013-07-16
    • 2021-10-12
    • 1970-01-01
    • 2013-12-20
    • 2018-03-26
    相关资源
    最近更新 更多