switch servers to a UTF-8 locale by default
no one probably ever noticed this, but our servers all run on a plain "C" locale, which means many programs cannot parse UTF-8 characters by default.
this was mostly not a problem: until very recently, SSH client's environment would propagate to the server, which means many users had, in effect, a UTF-8 locale. mine, for example, is fr_CA.UTF-8.
but that also meant that error messages would get translated into whatever language the user is using, which made collaboration harder. so this was turned off in:
commit 1e1fc35ef105b854456586815dd093e27f80635e
Author: Antoine Beaupré <anarcat@debian.org>
Date: Tue Jan 21 16:02:34 2020 -0500
do accept LANG or LC_* variables in sshd
While it's great that Debian GNU/Linux translates its messages for
users all over the world, the Tor Project is an international
community where it's preferable to communicate in the current "lingua
franca", english. By accepting client-specific locales, we are
breaking that common language and making it harder to collaborate.
This also happens to irritate weasel because my locale is french and
that leaks out to some error messages and output in my
copy-pastes. This should solve the problem for him, hopefully,
eventually.
diff --git a/modules/ssh/templates/sshd_config.erb b/modules/ssh/templates/sshd_config.erb
index c79b3a9b..6b63b429 100644
--- a/modules/ssh/templates/sshd_config.erb
+++ b/modules/ssh/templates/sshd_config.erb
@@ -113,7 +113,7 @@ TCPKeepAlive yes
#Banner none
# Allow client to pass locale environment variables
-AcceptEnv LANG LC_*
+#AcceptEnv LANG LC_*
# override default of no subsystems
Subsystem sftp /usr/lib/openssh/sftp-server
Unfortunately, this had the effect of turning my environment into a plain, default locale, which is "Not set" according to dpkg-reconfigure locales
, which probably means the default C
locale.
This meant I started getting weird errors. One of those happened while starting vim, for example:
root@fsn-node-03:~# vim
Error detected while processing /root/.vimrc:
line 13:
E474: Invalid argument: listchars=tab:»·,trail:·
Press ENTER or type command to continue
My first reaction was to remove this line at all, which I did in commit 0bcad064. But then I realized this problem was triggered by the absence of a UTF-8 locale.
So I'm proposing we switch to a C.UTF-8 locale everywhere by default. That way at least we'd get unicode to display properly everywhere.
I'm marking this as high priority because those weird things could happen to other people and i don't want to leave this fuzzy situation going on for too long.