Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
1. Use the third python already.
2. Use utf-8 in code.
3. If you're really impatient, use Unicode strings.
4. Do not use Windows.
There is still a zoo of cp866 , cs1251 and utf-8 in consoles, shell scripts and everywhere... target encoding.
From what and to what encoding - read in the parameters of the input / output stream. If not listed, try to distinguish whether the stream is associated with a file or with a terminal. You can write any encoding to the file, the main thing is to convert it correctly and not mix it. You need to write to the terminal either in unicode (if the encoding is specified in the stream parameters, then the python itself will convert), or in the target encoding, which can be configured / guessed, assumed and selected from several attempts.
But it's best to use the third python. There, with Unicode, everything is much simpler and more unambiguous than in the second.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question