Public bug reported:
Problem:
The adduser package in Ubuntu 26.04 (resolute) displays Chinese translations
incorrectly under zh_CN.UTF-8 locale.
Expected behavior:
Chinese messages should be displayed correctly, for example:
fatal: 用户 "testuser" 已经存在
Actual behavior:
fatal: ç¨æ·"testuser"å·²ç»å¨ã
The output is UTF-8 mojibake.
Steps to reproduce:
1. Install Ubuntu 26.04.
2. Set locale:
LANG=zh_CN.UTF-8
3. Run:
sudo adduser testuser
where testuser already exists.
The output is corrupted Chinese text.
System information:
Ubuntu version:
Ubuntu 26.04 (resolute)
Package:
adduser:
Installed: 3.153ubuntu1
Locale:
LANG=en_US.UTF-8
LANGUAGE=zh_CN.UTF-8
LC_MESSAGES="en_US.UTF-8"
The problem also happens with:
LANG=zh_CN.UTF-8 sudo adduser testuser
and:
LANGUAGE=zh_CN.UTF-8 LC_ALL=zh_CN.UTF-8 sudo adduser testuser
Investigation:
The locale configuration is correct.
Terminal UTF-8 output works correctly:
printf "你好,世界\n"
The translation catalog is valid:
/usr/share/locale-langpack/zh_CN/LC_MESSAGES/adduser.mo
contains valid UTF-8 translations.
Example:
msgunfmt adduser.mo
shows:
Content-Type: text/plain; charset=UTF-8
The issue appears to be related to Perl gettext handling.
Testing:
Locale::gettext returns UTF-8 bytes without Perl UTF-8 flag:
Example:
perl -MLocale::gettext -MEncode ...
Output:
utf8 flag: 0
raw: 正在添加组"%s" (GID %d)...
The adduser source uses:
/usr/share/perl5/Debian/AdduserLogging.pm
with:
gettext($fmt)
but does not appear to decode UTF-8 gettext output before printing.
This causes UTF-8 bytes to be interpreted incorrectly and displayed as:
ç¨æ·...
Expected fix:
The gettext result should be decoded as UTF-8 before further
processing/output, or the gettext domain should explicitly use UTF-8
codeset.
ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: adduser 3.153ubuntu1 [modified:
usr/share/perl5/Debian/AdduserLogging.pm]
Uname: Linux 7.2.0-070200rc3-generic x86_64
ApportVersion: 2.34.0-0ubuntu2
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: KDE
Date: Mon Jul 13 10:03:28 2026
InstallationDate: Installed on 2026-02-11 (152 days ago)
InstallationMedia: Ubuntu 26.04 LTS "Resolute Raccoon" - Daily amd64 (20251101)
PackageArchitecture: all
SourcePackage: adduser
UpgradeStatus: No upgrade log present (probably fresh install)
** Affects: adduser (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug resolute wayland-session
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2160476
Title:
adduser 3.153ubuntu1 displays UTF-8 Chinese translations as mojibake
under zh_CN.UTF-8
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/adduser/+bug/2160476/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs