我试图从Qpython打印Unicode字符
尝试打印诸如Qpython 3.6(在带有Chrome OS 100的Chromebook上的Android下)之类的Unicode字符,但打印(U“┌┌┝├”)什么也没打印,并且使用\ u不起作用,因为\是QPYTHON中的线延续特征。也许对Android-Over-Chrome Os-over-Linux的夹有夹有夹心使这不可能 - 这肯定超出了我的诊断能力 - 但我希望像Python这样的高级语言可能能够弥合这一差距...
Trying to print unicode characters like ┌┌┝├ from QPython 3.6 (under Android on a Chromebook with Chrome OS 100) but print(u"┌┌┝├") prints nothing, and using \u doesn't work since \ is the line continuation character in QPython. Perhaps the sandwiching of Android-over-Chrome OS-over-Linux makes this impossible - it's certainly beyond my diagnostic abilities - but I was hoping that a high-level language like Python might be able to bridge that gap...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
经过更多的研究,看起来Qpython 3.6的Chr()函数不接受u“ whthing”包含ASCII集外的字符,即。它根本不做Unicode
After a little more research it looks as though QPython 3.6's chr() function doesn't accept u"whatever" containing characters outside the ASCII set, ie. it isn't doing unicode at all
好的,请回答,既简单又羞辱地荒谬。浪费了几个小时的阅读文档和论坛后,当我注意到“偏好”按钮的“偏好”按钮,在Qpython控制台屏幕的顶部角(但不是编辑器屏幕)时,我正在运行Unicode测试程序。这些偏好包括一个tick框“默认为utf-8”,并立即解决了我的问题。我确实非常喜欢Qpython,但是它的文档,帮助和UI设计简直令人震惊 - 我花了两年的时间才找到这个盒子,而且没有人提到过。
OK, have answer, both simple and humiliatingly ridiculous. After wasting hours reading docs and forums, I was running my Unicode test program when I noticed the 'preferences' button, at top-right corner of QPython console screen (but not of editor screen) greyed-out so as to be almost illegible. Among those preferences is a tick box 'Default to UTF-8' and ticking it instantly cured my problems. I do love QPython very much, but its documentation, help and UI design are simply appalling - it's taken me two years to find this box, and no-one has ever mentioned it.