Answer the question
In order to leave comments, you need to log in
Why do krakozyabry crawl out?
Just learning how to make a website using python. And I decided to make a page with the Russian language, but krakozyabry came out:
I understand that the problem is with the encoding (most likely), but I just don’t understand where and how to fix it ...
Code:
#!/Python380/python
print("Content-type: text / html")
print(
"""
<html lang="ru">
<head>
<meta charset="utf-8">
<title>Проба с Python</title>
</head>
<body>
<h1><b>Привет</b></h1>
</body>
</html>
"""
)
Answer the question
In order to leave comments, you need to log in
import sys
import codecs
sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question