Python不允许我打印土耳其角色
即使我添加了评论以将编码更改为UTF-8,我也会遇到错误。我无法打印ü - üü
# -*- coding: utf-8 -*-
print("ğ")
遇到的错误
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf0 in position 0: unexpected end of data
我正在使用虚拟工作室2022和Python 3.10(我认为最新?)
Even though i add a comment to change the encoding to utf-8 i get an error. I can not print ü ğ ş ç İ Ş Ç Ğ Ö Ü
# -*- coding: utf-8 -*-
print("ğ")
The error i get
SyntaxError: (unicode error) 'utf-8' codec can't decode byte 0xf0 in position 0: unexpected end of data
I am using virtual studio 2022 and Python 3.10 (i think the latest ?)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该问题与Python或任何代码无关。
我的命令提示符窗口未调整为UTF-8。我在语言设置中更改了它。不过,感谢您的回复!
The issue was not related to python or any code.
My command prompt window was not adjusted to utf-8. I changed it in the language settings. Thanks for your reply nonetheless sidereal !
您需要使用
encoding ='utf-8'
您是否阅读” 已经问了吗?
土耳其语言有不同的Unicodes,您可以使用Unicodes列表“解密”它们。看看我提供的链接
You need to use
encoding='utf-8'
Have you read this question already?
There are different unicodes for the Turkish language, you can 'decrypt' them by using the list of unicodes. Take a look at the link I provided