From 069afc183aab007b9e0c764582fd0c6b1a92e6d0 Mon Sep 17 00:00:00 2001 From: The-going <48602507+The-going@users.noreply.github.com> Date: Wed, 10 Jun 2020 19:38:10 +0300 Subject: [PATCH] Fix file encoding of the locale generator (#2000) This is a minimal fix for the correct display of characters in the applications, especially the console. For example, if the locale-gen command is only for one locale locale-gen ru_RU.UTF-8 Then the console application MC instead of a line in the frame outputs: @ @@@@@@@@@@@@@@@@@@ @ README.md @@@@@@@@@@@@@@@@@@ @ @ Setting variables to LC_ALL=C LANG=C is not necessary in this construction. The line with the editor is not needed. The 'locale-gen en_US.UTF-8 xx_XX.UTF-8' command will fix this file itself. --- lib/debootstrap.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/debootstrap.sh b/lib/debootstrap.sh index 51b38d7ef1..7e07a4e66a 100644 --- a/lib/debootstrap.sh +++ b/lib/debootstrap.sh @@ -189,9 +189,8 @@ create_rootfs_cache() # stage: configure language and locales display_alert "Configuring locales" "$DEST_LANG" "info" - [[ -f $SDCARD/etc/locale.gen ]] && sed -i "s/^# $DEST_LANG/$DEST_LANG/" $SDCARD/etc/locale.gen - eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "locale-gen $DEST_LANG"' ${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} - eval 'LC_ALL=C LANG=C chroot $SDCARD /bin/bash -c "update-locale LANG=$DEST_LANG LANGUAGE=$DEST_LANG LC_MESSAGES=$DEST_LANG"' \ + eval 'chroot $SDCARD /bin/bash -c "locale-gen en_US.UTF-8 $DEST_LANG"' ${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} + eval 'chroot $SDCARD /bin/bash -c "update-locale LANG=$DEST_LANG LANGUAGE=$DEST_LANG LC_MESSAGES=$DEST_LANG"' \ ${OUTPUT_VERYSILENT:+' >/dev/null 2>/dev/null'} if [[ -f $SDCARD/etc/default/console-setup ]]; then