[issue18118] curses utf8 output broken in Python2

2013-06-03 Thread STINNER Victor
STINNER Victor added the comment: "Sounds sensible. Are you aware of a workaround for this issue? I.e. is there any way to force Python2.7 to use the wide mode for outputting characters?" I don't think that it is possible to workaround this issue, it is a bug in the design of curses, related to

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread helmut
helmut added the comment: > I suppose that screen.addstr(0, 0, u"äöü".encode("utf-8")) works. It works as in "the output looks as the one expected". Long lines with utf8 characters will make it break again though. screen.addstr(0, 0, "äöü" * 20) # assuming COLUMNS=80 Will give two rows of cha

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread STINNER Victor
STINNER Victor added the comment: u"äöü" encoded to "utf-8" gives '\xc3\xa4\xc3\xb6\xc3\xbc' "\303\303\303\274" is '\xc3\xc3\xc3\xbc'. I guess that curses considers that '\xc3\xa4' is a string of 2 characters: screen.addstr(0, 1, "ö") replaces the second "character", '\xa4'. I suppose that sc

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread helmut
helmut added the comment: All reproducers confirmed that their _cursessomething.so is linked against libncursesw.so.5. -- ___ Python tracker ___

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread STINNER Victor
STINNER Victor added the comment: Is your Python curses module linked to libncurses.so.5 or libncursesw.so.5? Example: $ ldd /usr/lib/python2.7/lib-dynload/_cursesmodule.so |grep curses libncursesw.so.5 => /lib/libncursesw.so.5 (0x00375000) libncursesw has a much better support of Unic

[issue18118] curses utf8 output broken in Python2

2013-06-02 Thread R. David Murray
R. David Murray added the comment: I believe this is one of a class of bugs that are fixed in Python3, and that are unlikely to be fixed in Python2. I'll defer to Victor, though, who made a number of curses unicode fixes in Python3. -- nosy: +haypo, r.david.murray title: curses utf8 o