dselect does not support UTF-8 so I have prepared a patch (attached) to fix it.
What this patch do:
- compile dselect with libncursesw5 instead of libncurses
- calculate and use string widths in colums instead of sizes in bytes
when needed (use standart C99 functions for this).
- text wrapping code is too complicated for me to rewrite it, so i
have used libtextwrap for that.
Problems:
- textwrap hangs if string contains illegal symbols (in UTF-8), this
is bug #237630. So debconf hangs while displaying description for
some packages (doc-linux-text-pt -- is it a bug in this package
too?).
- text wrapping is different for some packages (manpages - is its'
dsecription (indentation) correct?)
- it does not display horisontal lines around section descriptions in
linux terminal with KOI8-U encoding (but displays them in jfbterm
and konsole and with UTF-8 encoding -- may be bug in libncursesw?)
- some format strings was changed, requires new translations.
I have tested this patch with ru_RU and ja_JP locales. I have not found
other problems. Text with both languages looks same with different
encodings (KOI8-R and UTF-8 for Russian, EUC-JP and UTF-8 for Japanese).
I tested the patch in my ko_KR.UTF-8 locale and it worked very well. All the UTF-8 breakages seemed to be fixed.
*addnstr() functions. New patch attached: I wrote some replacement functions for those functions to fix them.
A bit more simplified patch attached.
If the patch is too long to be accepted for now, how about starting with replacing libncurses5 with libncursesw5? Just replacing, without touching other things, is also useful. The only problem is that libncursesw5 is not in base... but after sarge all programs can be replaced.
This has been done some time ago when it really broke badly. For the rest of your patch, I just forward-ported it to the current git tree, the fix for #342495 was in conflict with your patch and had to be redone given that you use libtextwrap. Apart from that and from some build-system adjustement, the patch applied mostly fine. I built an udpated dselect and it seems to work as expected. I'm a bit uneasy however with adding a libtextwrap dependency on dpkg for dpkg. Given that dselect can be completely disabled in the build system it doesn't complicate the bootstrap process of a new architecture but still it would be nice if someone could just fix the code to not require it at all. Please test and keep me informed! We can then merge the patch if it doesn't have any other side-effects. Cheers,
Some other conflicting changes have been merged in the mean time. I reupdated the patch and I'm keeping a branch here: http://git.debian.org/?p=users/hertzog/dpkg.git;a=shortlog;h=refs/heads/pu/bug237675-dselect-wide-char-support Cheers,
Hello. 1.14.20 version have truncated menu (locale is ru_RU.UTF-8).
Hello I would say this is only cosmetic issue now. Or is there a place where dselect fails due to this issue? Apparently dslelct calculates the string length incorrectly and the strings are truncated more or less depending on the amount of multibyte characters included but it errs on the side of safety and displays shorter strings than would fit. Thanks Michal
Hello. Yes, it is only cosmetic issue (dselect 1.15.8.4). But software with utf-8 problems seems questionably in 2010 year.
Quoting Yuri Kozlov (yuray@komyakino.ru): dselect is questionable in 2010..:-)
I have a brief project that will be of interest to you. Reach me back via email (azzopardi@sonic.net) to know more details.