Skip to content

Commit d76efec

Browse files
committed
feat: add locales to allow using utf-8 characters on the console
1 parent eeaadb9 commit d76efec

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

images/child-device-systemd/child.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM debian:12-slim
33
# Install
44
RUN apt-get -y update \
55
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
6+
locales \
67
wget \
78
curl \
89
gnupg2 \

images/common/optional-installer.sh

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,22 @@ zstyle ':completion:*' menu select
6464
# bind shift+tab to reverse menu complete
6565
zmodload zsh/complist
6666
bindkey -M menuselect '^[[Z' reverse-menu-complete
67+
68+
# enable utf-8
69+
export LC_ALL=C.UTF-8
70+
export LANG=C.UTF-8
71+
export LANGUAGE=C.UTF-8
72+
EOT
73+
}
74+
75+
set_bash_defaults() {
76+
cat <<EOT
77+
. /etc/profile
78+
79+
# enable utf-8
80+
export LC_ALL=C.UTF-8
81+
export LANG=C.UTF-8
82+
export LANGUAGE=C.UTF-8
6783
EOT
6884
}
6985

@@ -72,8 +88,9 @@ configure_shells() {
7288

7389
# bash
7490
echo '[ -f /etc/bash_completion ] && source /etc/bash_completion' >> /etc/profile.d/load_completions.sh
75-
echo '. /etc/profile' >> ~/.bashrc
76-
echo '. /etc/profile' >> "/home/$TEST_USER/.bashrc"
91+
set_bash_defaults >> ~/.bashrc
92+
set_bash_defaults >> "/home/$TEST_USER/.bashrc"
93+
7794
if [ ! -e /etc/bash_completion ]; then
7895
ln -sf /usr/share/bash-completion/bash_completion /etc/bash_completion
7996
fi

images/debian-systemd/debian-systemd.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ENV INSTALL="false"
99
# Install
1010
RUN apt-get -y update --allow-releaseinfo-change \
1111
&& DEBIAN_FRONTEND=noninteractive apt-get -y --no-install-recommends install \
12+
locales \
1213
wget \
1314
curl \
1415
gnupg2 \

0 commit comments

Comments
 (0)