# Set C.UTF-8 with /etc/rc.conf only?



## Spartrekus (Feb 21, 2019)

Hello,

Locale is sometimes important. I usually like that same things or setting things are located at the same place, ideally into /etc/rc.conf (instead of login.conf). I try to have mostly a single configuration file /etc/rc.conf that works for my machines. I need to have C.UTF-8 on several machines, ideally into /etc/rc.conf.

What would be a possible idea, workaround or hack to get this into /etc/rc.conf?

Thank you in advance for your ideas!!


----------



## olli@ (Feb 22, 2019)

Basically, the setting of the locale is a user setting, not a system setting. User “X” might want to use `en_US.UTF-8`, while user “Y” prefers `de_DE.ISO8859-15`, and so on. Some might even want to have no locale setting at all, thus implicitly using the POSIX default locale (a.k.a. C). Therefore it should be up to the user to set the locale. Usually this is done in your shell profile.

You can, of course, provide a global default. Since the locale is controlled by environment variables, you cannot do that with /etc/rc.conf, because this is only for configuring system services, not for environment variables. Instead, you can use the `charset`, `lang` and `setenv` capabilities in /etc/login.conf.

Personally I only set `LC_CTYPE` in order to get UTF-8, but none of the other locale variables, so I get standard POSIX collation, date/time format, and so on. There are badly written scripts that try to parse the output of ls(1) and other tools, and they get confused (read: they break) if they get “24 Dez. 2017” instead of “Dec 24 2017”. Apart from that, I don't want to see translated messages from tools, because often those translations are funny (read: bad, incomplete or confusing), especially when the translators employed great creativity to translate technical terms that don't have common translations and that can't be found anywhere in the documentation. I've already seen too much of that. So I prefer plain English.

PS: *Please* stop underlining words that are not links. It's confusing and annoying. It's ok to use _italics_ (emphasis) or – sparingly – *bold* (strong emphasis).


----------

