Your "normal user" doesn't have the locale set so that ncurses sees that it supports UTF-8 encoding. To see the difference, run the locale
command as your normal user, and compare it with the output when running as root.
The M
, by the way, means "meta", which denotes a character with the eighth (most-significant) bit set. Back in the day when 7-bit ASCII was common, and 8-bit characters relatively new, some people decided to treat that specially. If your locale is not set (i.e., POSIX), that's essentially 7-bit ASCII.
Some of that (including the use of M-
as a prefix) is mentioned in the manual page for unctrl
.
Regarding the followup (which relies upon information not in the question), that's an old problem with Python which I'd thought was fixed. As I pointed out in python+ncurses: I can't display accents, Python doesn't really distinguish between ncurses
and ncursesw
based on their interfaces, but only their name, and that some other components may load the wrong name before you get to the curses module:
It's more complicated than that: python's loading "ncurses"
dynamically.
It doesn't matter much (to python) which one it loads, but it's
specifying the library name explicitly. At the same time, some other
packages (such as readline) are separately loading the ncurses library
- and they also specify a library name. Rather than abstracting that
stuff out to another (more easily changed) level, it's embedded in the code.
If the initialization script is changed to load "ncursesw" then python
can use ncursesw without further change. There are a few patches to the
configuration that I've seen mentioned in the bug reports to enable
python to do this. Those are patches to python of course...
(this was a topic of discussion on this newsgroup about a year ago).