I just need convert entered text(bytes) to string. But if i on cyrillic press Backspace and some character, python throw me this error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 10: invalid continuation byte
What i can do?
# -*- coding: utf-8 -*-
from re import sub
import curseschatting = True
cols = 0
lines = 0def get_msg(stdscr):str_text = ""while chatting:inpwin = curses.newwin(2, 30, 1, 0)text = inpwin.getstr()str_text = str(text, "utf-8") # this string throw errorstdscr.addstr(0, 0, str_text)stdscr.refresh()def main(stdscr):curses.echo()stdscr.scrollok(True)global colsglobal lineslines, cols = stdscr.getmaxyx()get_msg(stdscr)curses.wrapper(main)