Skip to content Skip to sidebar Skip to footer

Stdscr.getstr() Ignore Keys, Just String

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 deco

Solution 1:

str_text = str(text, "utf-8") 

I had to add errors argument:

str_text = str(text, "utf-8", errors="ignore")

Post a Comment for "Stdscr.getstr() Ignore Keys, Just String"