# Unicode, python, readline, and ncursesw



## BlueCoder2 (Dec 25, 2011)

ncursesw is a drop in library for curses, it just extends it to also handle unicode.

I'm trying to program curses through python. I want to use the unicode line drawing glyphs as well as being able to view accented characters.

Problem is that it uses the readline library.  The readline in the main distro uses the non unicode legacy libncurses. Since both libncurses and libncursesw both link to the same symbols you can't mix them in the same program address space.

Is there any easy way to get everything everything in the main distro to compile using the the unicode version of ncurses? Something I can put in make.conf? What about a global default for ports?


----------



## BlueCoder2 (Dec 26, 2011)

Just an update. I decided not to play around with the ports version of readline. I ended up simply changing:


```
LDADD=  -ltermcap
```
to

```
LDADD=  -ltermcapw
```
in ./gnu/lib/libreadline/readline/Makefile.

I compiled it locally and copied the libreadline.so.8 into /lib. After this I just recompiled python27 and set the LANG environment variable and it worked. Now I'm wondering what other things will be affected by this down the line. Next up is buildworld and finally rebuilding ports.

I'm wondering now why libcursesw isn't used by everything in base by default as well as ports. Even in embedded systems I image they will want to use UTF-8 for strings. Sure it's a bigger library but computers are global now and we aren't locked to 8 bit character sets anymore.


----------



## itcotbtoemik (Dec 27, 2011)

BlueCoder2 said:
			
		

> ncursesw is a drop in library for curses, it just extends it to also handle unicode.



"drop in" generally doesn't apply where the binary interface changes.


----------

