D
D
Dubolom Unicellular2020-05-02 00:19:44
Python
Dubolom Unicellular, 2020-05-02 00:19:44

Why does Python 3 give out porridge from Russian characters?

I tried running a regular python file:

# -*- coding: utf-8 -*-
print("Привет мир!")

Then I enter in the console: python App.py
But I see THIS:
╨Я╤А╨╕╨▓╨╡╤В ╨╝╨╕╤А!

I tried and like this: # coding=utf-8
And like this:
## coding=utf-8
No use

How to fix it? (Windows 10 python 3.8.2 in my opinion, in short the newest version)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Andy_U, 2020-05-02
@Andy_U

No, you need to save the Python file itself in utf-8 encoding, even the BOM is not needed. How? Or in IDE, or in FAR'e.

D
Dmitry, 2020-05-02
@LazyTalent

Change the encoding in the console to utf-8

A
Andrey Sobolev, 2020-05-02
@Sobolev5

It is not necessary to write in python3 # -*- coding: utf-8 -*-.
The solution is to look at the encoding of the file (for example, in notepad++, pspad), it should be utf-8
. It's even better to use VsCode, there are no such problems in principle.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question