You are not logged in.
Pages: 1
Hi forum!
When I load the ncurses module in python it doesn't give unicode support. I read a few things about ncursesw being installed differently on Arch, but all the examples for compiling code are C++ examples, where to find the right headers etc.
Is it possible to use ncursesw in python on arch?
I don't mind my code being exclusively compatible with arch, doesn't have to be platform independant.
Thanks in advance!
Edit: code example:
(this is pretty much copied from an example which works on debian/ubuntu)
import curses
import locale
locale.setlocale(locale.LC_ALL, '')
stdscr = curses.initscr()
stdscr.addstr('a') <----- works
stdscr.addstr('a',curses.A_UNDERLINE) <----- works
# stdscr.addstr(u'\u2019'.encode('utf_8')) <----- syntax error.
stdscr.getch()
curses.endwin()
Last edited by Feroxium (2012-01-21 18:22:55)
Offline
Ah, I found the answer myself after reading the Python docs very carefully.
I'm still used to 2.x, and my Arch setup has Python 3.2 running.
Literal unicode string without the "u" prefix works.
stdscr.addstr('\u2019')
Offline
Pages: 1