Python不允许我打印土耳其角色

发布于 01-21 04:36 字数 291 浏览 2 评论 0原文

即使我添加了评论以将编码更改为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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ゃ人海孤独症 2025-01-28 04:36:10

该问题与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 !

傲影 2025-01-28 04:36:10

您需要使用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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文