[lxc-debian] Handle languages that are only UTF-8 encoded

Signed-off-by: Pierre-Elliott Bécue <becue@crans.org>
This commit is contained in:
Pierre-Elliott Bécue 2020-03-20 11:43:02 +01:00
parent 31e76fe8af
commit e370cacc6c
No known key found for this signature in database
GPG Key ID: 29BFA0D079290ACA

View File

@ -129,7 +129,8 @@ EOF
chroot "$rootfs" locale-gen en_US.UTF-8 UTF-8 chroot "$rootfs" locale-gen en_US.UTF-8 UTF-8
chroot "$rootfs" update-locale LANG=en_US.UTF-8 chroot "$rootfs" update-locale LANG=en_US.UTF-8
else else
encoding=$(echo "$LANG" | cut -d. -f2) encoding=$(locale charmap)
[ -z "${encoding}" ] && encoding="UTF-8"
chroot "$rootfs" sed -e "s/^# \(${LANG} ${encoding}\)/\1/" \ chroot "$rootfs" sed -e "s/^# \(${LANG} ${encoding}\)/\1/" \
-i /etc/locale.gen 2> /dev/null -i /etc/locale.gen 2> /dev/null
cat >> "$rootfs/etc/locale.gen" << EOF cat >> "$rootfs/etc/locale.gen" << EOF