Re: python+ncurses: I can't display accents

2007-01-27 Thread Thomas Dickey
Fabrice DELENTE <[EMAIL PROTECTED]> wrote: > My system is Linux, and the distribution is Slackware 10.1. > I have > /lib/libncurses.so.5.4 > /lib/libncursesw.so.5.4 > so I even have the wide-chars version available. Any hint on the python > configuration? I didn't find any function that would al

Re: python+ncurses: I can't display accents

2007-01-27 Thread Fabrice DELENTE
It's solved, it was a locale problem: I put import locale locale.setlocale(locale.LC_ALL,"fr_FR.iso8859-1") at the beginning of the script, and now the 8-bit-chars show up correctly. Thanks all for your help. -- Fabrice DELENTE -- http://mail.python.org/mailman/listinfo/python-list

Re: python+ncurses: I can't display accents

2007-01-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Fabrice DELENTE wrote: > As support for 8-bit (and even unicode) is important for my script, is there > any hope? Should I switch to slang instead of curses? Take a look at urwid: http://excess.org/urwid/ Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.or

Re: python+ncurses: I can't display accents

2007-01-27 Thread Fabrice DELENTE
> Try "export LINES COLUMNS" to set them as environment variables. Thanks, it works. Didn't know that. -- Fabrice DELENTE -- http://mail.python.org/mailman/listinfo/python-list

Re: python+ncurses: I can't display accents

2007-01-27 Thread Carsten Haese
On 27 Jan 2007 07:43:59 GMT, Fabrice DELENTE wrote > Incidentally, I noticed something about the environment: in my > script, I use the LINES and COLUMNS environment vars that are set in > my shell: > > columns=int(os.environ.get("COLUMNS")) > lines=int(os.environ.get("LINES")) > > In the shell

Re: python+ncurses: I can't display accents

2007-01-26 Thread Fabrice DELENTE
Incidentally, I noticed something about the environment: in my script, I use the LINES and COLUMNS environment vars that are set in my shell: columns=int(os.environ.get("COLUMNS")) lines=int(os.environ.get("LINES")) In the shell, I get $ echo $LINES $COLUMNS 89 199 but python doesn't get these

Re: python+ncurses: I can't display accents

2007-01-26 Thread Fabrice DELENTE
To really be sure that the problem is when I use python, I tried in C: #include #include int main(void) { initscr(); /* Start curses mode */ // printw("àéïoù"); /* Print Hello World */ addstr("àéïoù");/* Print Hello World */ refresh(); /* Print it o

Re: python+ncurses: I can't display accents

2007-01-26 Thread Neil Cerutti
On 2007-01-27, Thomas Dickey <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote: >> I don't really expect it to work, but if anything will, that >> is it. Curses supports only ASCII and a some special symbol >> codes defined by curses. > > un - no. Curses supports whatever the fla

Re: python+ncurses: I can't display accents

2007-01-26 Thread Fabrice DELENTE
My system is Linux, and the distribution is Slackware 10.1. I have /lib/libncurses.so.5.4 /lib/libncursesw.so.5.4 so I even have the wide-chars version available. Any hint on the python configuration? I didn't find any function that would allow the unrestricted display of 8-bit chars. -- Fabri

Re: python+ncurses: I can't display accents

2007-01-26 Thread Thomas Dickey
Neil Cerutti <[EMAIL PROTECTED]> wrote: > I don't really expect it to work, but if anything will, that is > it. Curses supports only ASCII and a some special symbol codes > defined by curses. un - no. Curses supports whatever the flavor of curses you have does. Often that's the 8-bit flavor of n

Re: python+ncurses: I can't display accents

2007-01-26 Thread Fabrice DELENTE
> What happens when you try this? > stdscr.addstr(0,0, u"leçon".encode('iso8859-15')) > I don't really expect it to work And it doesn't... As support for 8-bit (and even unicode) is important for my script, is there any hope? Should I switch to slang instead of curses? -- Fabrice DELENTE --

Re: python+ncurses: I can't display accents

2007-01-26 Thread Neil Cerutti
On 2007-01-26, Fabrice DELENTE <[EMAIL PROTECTED]> wrote: >> What have you tried? > > I've tried > > stdscr.addstr(0,0,"aéïoù") > > or > > stdscr.addstr(0,0,"leçon") > > The ASCII chars show correctly, but the accented characters > don't, so I see 'ao' or 'leon' on the screen. > > The term in which

Re: python+ncurses: I can't display accents

2007-01-26 Thread Fabrice DELENTE
> What have you tried? I've tried stdscr.addstr(0,0,"aéïoù") or stdscr.addstr(0,0,"leçon") The ASCII chars show correctly, but the accented characters don't, so I see 'ao' or 'leon' on the screen. The term in which I display is 8-bit-able, so the problem is either on ncurses side, or on pytho

Re: python+ncurses: I can't display accents

2007-01-26 Thread Neil Cerutti
On 2007-01-26, Fabrice DELENTE <[EMAIL PROTECTED]> wrote: > I'm trying to display french characters (è -- that's e grave -- > or à -- agrave) in python 2.5, with the ncurses wrapper that > comes it, and I can't. My locale is set correctly > (fr_FR.iso885915), and my terminal (rxvt-unicode) is able

python+ncurses: I can't display accents

2007-01-26 Thread Fabrice DELENTE
Hello. I'm trying to display french characters (è -- that's e grave -- or à -- agrave) in python 2.5, with the ncurses wrapper that comes it, and I can't. My locale is set correctly (fr_FR.iso885915), and my terminal (rxvt-unicode) is able to display those chars. What am I missing? Thanks. --