Hi,
I'm trying to display a lot of unicode text in my curses application. My development machine is MacOSx 10.6 and I use the default python shipped with Apple.
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
When I added unicode text to the screen, the screen all messed up. I tried to Google for solution and other people has suggested to link the _curses module with libncursesw library instead of libncurse library.
I checked my path and I found (see below) in /opt/local/lib
libncurses++.a
libncurses++w.a
libncurses.5.dylib
libncurses.a
libncurses.dylib
libncursesw.5.dylib
libncursesw.a
libncursesw.dylib
How do I check which library my curses module linked to, and how can I link against other library? Is it possible to do it without recompile my Python?
This is kind of embarrassed, but I figure the solution to print unicode properly in my environment. I think at some point time I did install curses libraries from Macports and forgot I have it already.
The problem that the text did not display the first time is because I need to set the locale within my python program. I thought the locale setting would inherit from the shell I'm running, but simply added two lines of code fixed my problem:
import locale
locale.setlocale(locale.LC_ALL,"")
Though, it's good to know where the python external library lives and how to check them. Thanks for the answer below.