kconfig: fix multi-byte UTF handling in nconfig
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 8 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | kconfig: lxdialog: fix spellingscripts/ | +1 | 0 replies | |
| 2/2 | kconfig: nconfig: fix multi-byte UTF handlingscripts/ | +2 | 1 reply |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Sam Ravnborg |
|---|---|
| 1/2 | |
| 2/2 | A-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] kconfig: fix multi-byte UTF handling in nconfig
Hi,
The first patch is trivial.
The second is inspired by a long-standing bugzilla entry:
https://bugzilla.kernel.org/show_bug.cgi?id=43067
The MTD_NAND_CAFE Kconfig symbol (drivers/mtd/nand/Kconfig) has description text which uses a multi-byte UTF-8 character: the 'É' in 'CAFÉ'. This character (and other similar >8bit UTF-8 characters) is not handled correctly by many of the kernel configuration tools (notably 'make nconfig' and 'make xconfig'). nconfig was especially broken, as it would completely drop any menu entry which had non-ASCII characters, as well as ALL subsequent entries in the same window (!!).
The fix for nconfig is to allow linking against the "wide" ncurses library. I did not bother learning QT well enough to fix 'make xconfig'; it still appears broken w.r.t. wide characters, and makes liberal use of the QString::latin1() conversion for potentially non-Latin strings.
Notably, this issue is not very obvious for the common user. For instance, on Ubuntu one might install libncurses5-dev, which is sufficient for getting 'menuconfig' to compile/link/run just fine. It is easy to miss the fact that unicode handling is incorrect, because the behavior is undefined (usually just chunk characters, but nconfig just silently drops data), and nothing informs them that they should have installed libncursesw5-dev instead.
Ideally, we could drop support for linking against legacy ncurses, and instead require ncursesw, but that might be painful to enforce for all users (i.e., nearly everyone who configures kernels). I welcome any thoughts on improving this state for others (like me, for a long time) who don't realize that they should install the ncursesw development package in order to get 21st century support for unicode help text.
Brian
Brian Norris (2):
kconfig: lxdialog: fix spelling
kconfig: nconfig: fix multi-byte UTF handling
scripts/kconfig/Makefile | 3 ++- scripts/kconfig/lxdialog/dialog.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.9.5