Hi, I've switched to Python 3.0 for a new Japanese vocab quizzing application due to its much improved Unicode support. However, I'm running into an issue with displaying Unicode characters via curses. In Python 2.x a simple hello-world looks like:
#!/usr/bin/python # coding=UTF-8 import curses import locale locale.setlocale(locale.LC_ALL,"") def doStuff(stdscr): message = u"hello わたし!" stdscr.addstr(0, 0, message.encode("utf-8"), curses.A_BLINK) stdscr.getch() # pauses until a key's hit curses.wrapper(doStuff) This works. However, when I try to come up with an equivalent for Python 3.0: #!/usr/bin/python import curses import locale locale.setlocale(locale.LC_ALL,"") def doStuff(stdscr): message = "hello わたし!" stdscr.addstr(0, 0, message, curses.A_BLINK) stdscr.getch() # pauses until a key's hit curses.wrapper(doStuff) It fails (printing gibberish to the console). Anyone have a clue what I'm doing wrong? Thanks! -Damian PS. Is the "# coding=UTF-8" header meaningless in Python 3.0? Also, is "locale.setlocale(locale.LC_ALL,"")" still necessary for getting curses to provide Unicode support?
-- http://mail.python.org/mailman/listinfo/python-list