* "Martin v. Löwis" <[EMAIL PROTECTED]> [2006-01-20 07:33]: > I just tried to reproduce the problem, with python 2.3.5-9 > and libncurses5 5.5-1, and it just worked. I couldn't try > the original problem (since I don't know what to use cplay > for), but in Martin Michlmayrs test case, the bullets display > fine (the Japanese characters show as a dotted box, due > to a lacking glyph).
Woo, thanks for the note. I can confirm that this works now - I see the Chinese character too. However, while I can see the umlaut a and the Chinese ren, the bullet is not displayed properly. Do you get this too? Instead of • I see [EMAIL PROTECTED] > I also tried with stock trunk Python, and it also work, so it is > unlikely that something has changed in Python; instead, it appears > that ncurses does now do the right thing. Maybe Thomas can comment. BTW, I've attached the test program again. -- Martin Michlmayr http://www.cyrius.com/
#!/usr/bin/python # -*- coding: utf-8 *- import curses import time a = 'ä' b = '•' c = '人' u_a = unicode(a, "utf-8") u_b = unicode(b, "utf-8") u_c = unicode(c, "utf-8") print " - normal Python print -" print a print u_a print b print u_b print c print u_c time.sleep(3) w = curses.initscr() w.addstr(" - printing with curses -\n") w.addstr(" - normal string\n") w.addstr('umlaut a: ' + a) w.addstr("\n") w.addstr('bullet: ' + b) w.addstr("\n") w.addstr("Chinese ren: " + c) w.addstr("\n") w.addstr("\n") w.addstr(" - Unicode string\n") w.addstr('umlaut a: ' + u_a.encode("utf-8")) w.addstr("\n") w.addstr('bullet: ' + u_b.encode("utf-8")) w.addstr("\n") w.addstr("Chinese ren: " + u_c.encode("utf-8")) w.addstr("\n") w.addstr("\n") w.refresh() time.sleep(3) curses.endwin()