garbled recovery mode in Simplified Chinese language OS install
Bug #1752362 reported by
Eric Desrochers
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-
It doesn't affect/
[Other Info]
Old LP reference :
https:/
description: | updated |
description: | updated |
description: | updated |
description: | updated |
Changed in friendly-recovery (Ubuntu Artful): | |
importance: | Undecided → Medium |
Changed in friendly-recovery (Ubuntu Xenial): | |
importance: | Undecided → Medium |
tags: |
added: verification-done-artful removed: verification-needed-artful |
To post a comment you must log in.
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= "ar_ he_IL ja_JP ko_KR ru_RU sl_SI vi_VN zh_"
# blacklist some languages that we don't have a good console fonts for
# see bug #573502
in_lang_blacklist() {
LANG_
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 friendly- recovery /usr/share/ locale
export TEXTDOMAIN=
export TEXTDOMAINDIR=
---