In console when I'm trying output Russian characters It gives me ???????????????
Who know why?
I tried write to file - in this case the same situation.
for example
f=open('tets.txt','w')
f.write('some russian text')
f.close
inside file is - ?????????????????????????/
or
p="some russian text"
print p
?????????????
In additional Notepad don't allow me to save file with Russian letters. I give this:
This file contains characters in Unicode format which will be lost if you save this file as an ANSI encoded text file. To keep the Unicode information, click Cancel below and then select one of the Unicode options from the Encoding drop down list. Continue?
How to adjust my system, so I will don't have this problems.
On the “Keyboards and Languages” tab, click on “Change Keyboards” > “Add” > “Russian.” 4. Expand the option of “Russian” and then expand the option “Keyboard.” Select the keyboard layout marked as “Russian.” You can ignore other keyboard layouts. Click “OK” and then “Apply.”
Open your Notepad program. FROM the Notepad MENU, select the TXT-file that you have just saved with MS-Word. Just beside the "open" button, you have the possibility to choose the encoding format; select UTF-8. You should be able to read the Russian text as you saw it with MS-Word.
Russian and other Slavic languages are written in Cyrillic script, which is most often represented by the use of the KOI8-R or the ISO 8859-5 character sets.
Try opening the file using codecs, you need to
import codecs
and then
writefile = codecs.open('write.txt', 'w', 'utf-8')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With