garbled recovery mode in Simplified Chinese language OS install

Bug #1752362 reported by Eric Desrochers
22
This bug affects 2 people
Affects Status Importance Assigned to Milestone
friendly-recovery (Ubuntu)
Fix Released
Medium
Eric Desrochers
Xenial
Fix Released
Medium
Eric Desrochers
Artful
Fix Released
Medium
Eric Desrochers
Bionic
Fix Released
Medium
Eric Desrochers

Bug Description

[Impact]

The menu is garbled in recovery mode when using Chinese characters.

[Test Case]

1. Install Ubuntu with selected Simplified Chinese language.
2. Boot to recovery mode.
3. Most character won't be readable and will appear as black square.
(See "Bug attachment" for a screenshot)

[Regression Potential]

Regression risk is low.

The fix simply, in Recovery mode only, default the system variables to something the console can output when detecting a blacklisted LANG in lib/recovery-mode/l10n.sh

It doesn't affect/modify/change/... the system variables when booting in "normal" mode.

[Other Info]

Old LP reference :
https://bugs.launchpad.net/bugs/573502

Revision history for this message
Eric Desrochers (slashd) wrote :

Using root shell, I can reproduce the problem using the command line (not only reproducible in the dialog window)

Here's the system variable right after booting in Recovery mode took from the root shell option.

---
$ echo $LANG
zh_CN.UTF-8

$ echo $LANGUAGE
zh_CN:zh
---

If I change manually the system variables as follow :

--
export LANG=C.UTF-8
export LANGUAGE=en
---

The situation disappear.

friendly-recovery have a blacklist including a detection for "zh_" mechanism but doesn't seems to default $LANG and $LANGUAGE to good working console value to avoid this situation to happen with CJK font.

I have tested the following approach and it works by displaying in english when detect a known font which have not a good console output.

--
# blacklist some languages that we don't have a good console fonts for
# see bug #573502
in_lang_blacklist() {
    LANG_BLACKLIST="ar_ he_IL ja_JP ko_KR ru_RU sl_SI vi_VN zh_"
    LANG=$1
    for b in $LANG_BLACKLIST; do
        # equal to lang.startswith(b)
        if expr match "$LANG" ^"$b" >/dev/null ; then
+ export LANG=C.UTF-8
+ export LANGUAGE=en
            return 0
        fi
    done
    return 1
}

# There is no environment set, as these steps are skipped,
# so we need to source the variables needed for localization ourselves
if [ -r /etc/default/locale ]; then
 . /etc/default/locale
 if ! in_lang_blacklist "$LANG"; then
     export LANG LANGUAGE
 fi
elif [ -r /etc/environment ]; then
 . /etc/environment
 if ! in_lang_blacklist "$LANG"; then
     export LANG LANGUAGE
 fi
fi

. gettext.sh
export TEXTDOMAIN=friendly-recovery
export TEXTDOMAINDIR=/usr/share/locale
---

tags: added: sts
description: updated
Changed in friendly-recovery (Ubuntu Xenial):
status: New → Confirmed
Changed in friendly-recovery (Ubuntu Artful):
status: New → Confirmed
Changed in friendly-recovery (Ubuntu Bionic):
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Eric Desrochers (slashd)
status: Confirmed → In Progress
Revision history for this message
Eric Desrochers (slashd) wrote :

Example of the recovery mode with zh_CN.UTF-8 (which is 1 of the blacklisted language)

description: updated
Revision history for this message
Eric Desrochers (slashd) wrote :

debdiff for devel release (bionic)

description: updated
Eric Desrochers (slashd)
description: updated
Eric Desrochers (slashd)
description: updated
Revision history for this message
Eric Desrochers (slashd) wrote :

mvo uploaded the fix a few minutes ago.

Changed in friendly-recovery (Ubuntu Bionic):
status: In Progress → Fix Committed
Changed in friendly-recovery (Ubuntu Artful):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Xenial):
status: Confirmed → In Progress
Changed in friendly-recovery (Ubuntu Artful):
assignee: nobody → Eric Desrochers (slashd)
Changed in friendly-recovery (Ubuntu Xenial):
assignee: nobody → Eric Desrochers (slashd)
Eric Desrochers (slashd)
description: updated
description: updated
Changed in friendly-recovery (Ubuntu Artful):
importance: Undecided → Medium
Changed in friendly-recovery (Ubuntu Xenial):
importance: Undecided → Medium
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friendly-recovery - 0.2.37ubuntu1

---------------
friendly-recovery (0.2.37ubuntu1) bionic; urgency=medium

  * /lib/recovery-mode/l10n.sh (LP: #1752362)
    - Default to LANG "C.UTF-8" and LANGUAGE "en" when locales are part
      of a language blacklist which doesn't have a good console fonts.

 -- Eric Desrochers <email address hidden> Wed, 28 Feb 2018 11:26:37 -0500

Changed in friendly-recovery (Ubuntu Bionic):
status: Fix Committed → Fix Released
Revision history for this message
Eric Desrochers (slashd) wrote :

debdiff for xenial

Revision history for this message
Eric Desrochers (slashd) wrote :

debdiff for artful

Revision history for this message
Eric Desrochers (slashd) wrote :

Uploaded for Xenial and Artful.
Trusty is not affected.

no longer affects: friendly-recovery (Ubuntu Trusty)
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Eric, or anyone else affected,

Accepted friendly-recovery into artful-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/friendly-recovery/0.2.36ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-artful to verification-done-artful. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-artful. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in friendly-recovery (Ubuntu Artful):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-artful
Changed in friendly-recovery (Ubuntu Xenial):
status: In Progress → Fix Committed
tags: added: verification-needed-xenial
Revision history for this message
Łukasz Zemczak (sil2100) wrote :

Hello Eric, or anyone else affected,

Accepted friendly-recovery into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/friendly-recovery/0.2.31ubuntu1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Revision history for this message
Eric Desrochers (slashd) wrote :

[VERIFICATION XENIAL]

I confirmed after having tested friendly-recovery version 0.2.31ubuntu1 for Xenial in Recovery mode, that the proposed package default to English on a Chinese installation where the system variable $LANG is part of the language blacklist.

(See "Bug attachment" for a screenshot)

tags: added: verification-done-xenial
removed: verification-needed-xenial
Eric Desrochers (slashd)
tags: added: verification-done-artful
removed: verification-needed-artful
Revision history for this message
Eric Desrochers (slashd) wrote :

[VERIFICATION ARTFUL]

I confirmed after having tested friendly-recovery version 0.2.36ubuntu1 for Artful in Recovery mode, that the proposed package default to English on a Chinese installation where the system variable $LANG is part of the language blacklist.

(See "Bug attachment" for a screenshot)

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friendly-recovery - 0.2.36ubuntu1

---------------
friendly-recovery (0.2.36ubuntu1) artful; urgency=medium

  * /lib/recovery-mode/l10n.sh (LP: #1752362)
    - Default to LANG "C.UTF-8" and LANGUAGE "en" when locales are part
    of a language blacklist which doesn't have a good console fonts.

 -- Eric Desrochers <email address hidden> Wed, 28 Feb 2018 15:24:29 -0500

Changed in friendly-recovery (Ubuntu Artful):
status: Fix Committed → Fix Released
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for friendly-recovery has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package friendly-recovery - 0.2.31ubuntu1

---------------
friendly-recovery (0.2.31ubuntu1) xenial; urgency=medium

  * /lib/recovery-mode/l10n.sh (LP: #1752362)
    - Default to LANG "C.UTF-8" and LANGUAGE "en" when locales are part
    of a language blacklist which doesn't have a good console fonts.

 -- Eric Desrochers <email address hidden> Wed, 28 Feb 2018 15:23:43 -0500

Changed in friendly-recovery (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Eric Desrochers (slashd) wrote :

It has been brought to my attention the following as well from another user:

"
... below is our team verified and issue not repro with package installed. Thanks.
The issue is NOT reproducible with the package(friendly-recovery_0.2.37ubuntu1).
"

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.