0

I need to use get_wch() to get unicode characters with curses in python.

 ch = stdscr.get_wch()
 

I want to use TextBox to get chars. However, it seems it returns just ascii characters. How can I print unicode chars with TextBox?

martineau
  • 119,623
  • 25
  • 170
  • 301
Ahmad
  • 8,811
  • 11
  • 76
  • 141
  • The [curses documentation](https://docs.python.org/3/library/curses.html#) says "**Note** Since version 5.4, the ncurses library decides how to interpret non-ASCII data using the `nl_langinfo` function. That means that you have to call `locale.setlocale()` in the application and encode Unicode strings using one of the system’s available encodings." – martineau Dec 03 '20 at 20:25
  • It's more complicated than that, because the interface uses *bytes objects* rather than *strings*, requiring some juggling by the script to convert the encoding. – Thomas Dickey Dec 03 '20 at 23:38

0 Answers0