V
V
Vladislav2016-06-19 15:59:18
Python
Vladislav, 2016-06-19 15:59:18

How to make windows display Cyrillic?

Python 3
The application has a Label with Cyrillic text.
When you run the application from the console instead of text - krakozyabry.
tried

Label:
    text: str('какой-то текст',encoding='cp866')

produces this:

TypeError: decoding str is not supported
File "C:\Python34\lib\site-packages\kivy\lang.py", line 1742, in create_handler
return eval(value, idmap), bound_list
File ".\summ.kv", line 59, in
text: str("No network connection.\nTry again",encoding='cp866')
File "C:\Python34\lib\site-packages\kivy\lang.py", line 2115, in _apply_rulerctx ['ids'])
File "C:\Python34\lib\site-packages\kivy\lang.py", line 1747, in create_handler cause=tb)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladislav, 2016-06-19
@Hateman31

Decision:

Label:
    text: "Какой-то текст на русском".encode('cp1251').decode('utf-8')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question