ensure Python operates in UTF-8 with a consistent locale for all users
fixes #206 (hopefully)
This commit is contained in:
parent
145186a6b6
commit
4e6d572de9
2 changed files with 18 additions and 0 deletions
|
@ -25,6 +25,15 @@ SCRIPTNAME=/etc/init.d/$NAME
|
||||||
START=yes
|
START=yes
|
||||||
EXEC_AS_USER=root
|
EXEC_AS_USER=root
|
||||||
|
|
||||||
|
# Ensure Python reads/writes files in UTF-8. If the machine
|
||||||
|
# triggers some other locale in Python, like ASCII encoding,
|
||||||
|
# Python may not be able to read/write files. Here and in
|
||||||
|
# setup/functions.sh.
|
||||||
|
export LANGUAGE=en_US.UTF-8
|
||||||
|
export LC_ALL=en_US.UTF-8
|
||||||
|
export LANG=en_US.UTF-8
|
||||||
|
export LC_TYPE=en_US.UTF-8
|
||||||
|
|
||||||
# Read configuration variable file if it is present
|
# Read configuration variable file if it is present
|
||||||
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,12 @@
|
||||||
|
# Ensure Python reads/writes files in UTF-8. If the machine
|
||||||
|
# triggers some other locale in Python, like ASCII encoding,
|
||||||
|
# Python may not be able to read/write files. Here and in
|
||||||
|
# the management daemon startup script.
|
||||||
|
export LANGUAGE=en_US.UTF-8
|
||||||
|
export LC_ALL=en_US.UTF-8
|
||||||
|
export LANG=en_US.UTF-8
|
||||||
|
export LC_TYPE=en_US.UTF-8
|
||||||
|
|
||||||
function hide_output {
|
function hide_output {
|
||||||
# This function hides the output of a command unless the command fails
|
# This function hides the output of a command unless the command fails
|
||||||
# and returns a non-zero exit code.
|
# and returns a non-zero exit code.
|
||||||
|
|
Loading…
Reference in a new issue