I had a problem with app-misc/mc built with slang (unicode enabled). When I use mc in utf-8 terminal with utf-8 locale (LANG=ru_RU.utf-8) it crashes on exit leaving terminal in black-and-white state.
I took a look to slang shipped with Fedora Core 3 and found one tiny slang patch which is missing from Gentoo's slang-1.4.9-r1.ebuild (patch name is slang-1.4.5-utf8-segv.patch). I have created slang-1.4.9-r2 with this patch added and found out the problem with mc is now gone. So I think it makes sense to add this patch.
How to reproduce
1. Build slang and mc with the following USE flags:
sys-libs/slang-1.4.9-r2 -cjk +unicode
app-misc/mc-4.6.0-r13 +X -debug +gpm -ncurses +nls +samba +slang +unicode
2. Open X terminal (I used both gnome-terminal and uxterm)
3. export LANG=ru_RU.utf8
(press F10 and Enter)
4. See mc crash.
Rebuild slang with the attached patch.
Created attachment 58972 [details, diff]
slang patch fixing mc coredump
This patch is taken from Fedora Core 3
utf-8 team might be interested, as this is definitely UTF-8 related bug.
You might me interested as well.
added to slang-1.4.9-r2