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:<br>
<br>#!/usr/bin/python<br># coding=UTF-8<br><br>import curses<br>import locale<br><br>locale.setlocale(locale.LC_ALL,"")<br><br>def doStuff(stdscr):<br>  message = u"hello わたし!"<br>  stdscr.addstr(0, 0, message.encode("utf-8"), curses.A_BLINK)<br>
  stdscr.getch() # pauses until a key's hit<br><br>curses.wrapper(doStuff)<br><br>This works. However, when I try to come up with an equivalent for Python 3.0:<br><br>#!/usr/bin/python<br><br>import curses<br>import locale<br>
<br>locale.setlocale(locale.LC_ALL,"")<br><br>def doStuff(stdscr):<br>  message = "hello わたし!"<br>  stdscr.addstr(0, 0, message, curses.A_BLINK)<br>  stdscr.getch() # pauses until a key's hit<br><br>
curses.wrapper(doStuff)<br><br>It fails (printing gibberish to the console). Anyone have a clue what I'm doing wrong? Thanks! -Damian<br><br>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?<br>
<br>