Public bug reported:

While running adduser and deluser under a ru_RU.UTF-8 locale, translated
messages that interpolate a variable (filename, path, etc.) are displayed
as garbled text (mojibake), consistent with double-encoded UTF-8.

Example:

$ sudo adduser natasha
...
ÐÐ°Ð½Ð½Ð°Ñ Ð¸Ð½Ñ Ð¾ÑмаÑÐ¸Ñ ÐºÐ¾ÑÑекÑна? [Y/n]

(Expected: "Данная информация корректна? [Y/n]")

$ deluser
fatal: ТолÑко ÑÑпеÑполÑзоваÑÐµÐ»Ñ Ð¼Ð¾Ð¶ÐµÑ ÑдалиÑÑ 
полÑзоваÑÐµÐ»Ñ Ð¸Ð»Ð¸ гÑÑÐ¿Ð¿Ñ Ð¸Ð· ÑиÑÑемÑ.

(Expected: "fatal: Только суперпользователь может удалить пользователя
или группу из системы.")

$ sudo LANG=ru_RU.UTF-8 deluser --test natasha 2>&1 | head -5
Unknown option: test
deluser [--system] [--remove-home] [--remove-all-files] [--backup]
        [--backup-to каÑалог] [--backup-suffix ÑÑÑока] [--conf Ñ 
айл]
        [--quiet] [--verbose] [--debug] полÑзоваÑелÑ

Steps taken to isolate the cause:

1. Confirmed the system locale is fully and correctly set:

   $ locale
   LANG=ru_RU.UTF-8
   LC_CTYPE="ru_RU.UTF-8"
   ... (all LC_* = ru_RU.UTF-8)

2. Confirmed other localized tools (bash, getent, apt) render Cyrillic
   correctly in the same terminal/session, ruling out a terminal
   encoding issue.

3. Located the actual translation file in use:

   /usr/share/locale-langpack/ru/LC_MESSAGES/adduser.mo

4. Dumped it with msgunfmt and confirmed the translated strings are
   stored correctly as UTF-8, e.g.:

   msgstr "Невозможно прочитать каталог «%s»."
   msgstr "Не удалось создать домашний каталог «%s»: «%s»."

So the .mo file itself is fine, and it is not a terminal/locale
misconfiguration on the user's side. The corruption appears only in
strings that are built by interpolating a variable into a translated
string at runtime, which strongly suggests a Perl UTF-8 "upgrade"
double-encoding issue: a UTF-8 byte string returned by gettext is being
concatenated with a Perl-internal (decoded) string without both being
consistently flagged/decoded as UTF-8, causing Perl to re-encode
already-UTF-8 bytes as if they were Latin-1.

liblocale-gettext-perl 1.07-8 is installed on this system, which is the
module adduser uses to read translations — noted here as a possible
lead for where the encoding mismatch is introduced.

Expected behavior:
Interpolated translated strings should render as correct Cyrillic text.

Actual behavior:
Interpolated translated strings are mojibake / double-encoded UTF-8,
while static (non-interpolated) translated strings and messages from
other tools display correctly.

Package version: adduser 3.153ubuntu1 (Ubuntu 26.10 "resolute")

ProblemType: Bug
DistroRelease: Ubuntu 26.04
Package: adduser 3.153ubuntu1
ProcVersionSignature: Ubuntu 7.0.0-28.28-generic 7.0.12
Uname: Linux 7.0.0-28-generic x86_64
ApportVersion: 2.34.1-0ubuntu0.1
Architecture: amd64
CasperMD5CheckResult: pass
Date: Wed Jul 29 20:52:47 2026
InstallationDate: Installed on 2026-07-07 (22 days ago)
InstallationMedia: Ubuntu 26.04 "Resolute Raccoon" - Release amd64 (20260423.1)
PackageArchitecture: all
ProcEnviron:
 LANG=ru_RU.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
SourcePackage: adduser
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: adduser (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug resolute

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2162080

Title:
  adduser/deluser output mojibake (double-encoded UTF-8) in ru_RU.UTF-8
  locale, though translation .mo file is correct

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/adduser/+bug/2162080/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to