#237675 [UTF-8] patch for dselect UTF-8 support

Package:
dselect
Source:
dpkg
Description:
Debian package management front-end
Submitter:
Eugeniy Meshcheryakov
Date:
2023-05-24 17:06:03 UTC
Severity:
normal
Tags:
#237675#5
Date:
2004-03-12 17:37:32 UTC
From:
To:
  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).

#237675#14
Date:
2004-06-20 10:47:07 UTC
From:
To:
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.

#237675#19
Date:
2004-06-20 13:08:55 UTC
From:
To:
*addnstr() functions.

New patch attached: I wrote some replacement functions for those
functions to fix them.

#237675#24
Date:
2004-06-22 19:25:31 UTC
From:
To:
A bit more simplified patch attached.
#237675#33
Date:
2005-03-03 07:18:20 UTC
From:
To:
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.

#237675#42
Date:
2008-06-27 21:14:45 UTC
From:
To:
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,

#237675#47
Date:
2008-07-06 19:32:49 UTC
From:
To:
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,

#237675#52
Date:
2008-07-23 17:50:18 UTC
From:
To:
Hello.

1.14.20 version have truncated menu (locale is ru_RU.UTF-8).

#237675#59
Date:
2010-09-16 13:56:14 UTC
From:
To:
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

#237675#64
Date:
2010-09-16 14:50:45 UTC
From:
To:
Hello.

Yes, it is only cosmetic issue (dselect 1.15.8.4).
But software with utf-8 problems seems questionably in 2010 year.

#237675#69
Date:
2010-09-16 18:19:45 UTC
From:
To:
Quoting Yuri Kozlov (yuray@komyakino.ru):

dselect is questionable in 2010..:-)

#237675#74
Date:
2023-05-24 17:02:33 UTC
From:
To:
I have a brief project that will be of interest to you. Reach me back via email (azzopardi@sonic.net) to know more details.