I've been administering a FreeBSD system through SSH, and she doesn't seem to like the non-ASCII characters I've entered.

One noted in the bug report that the problem got fixed with the C.UTF-8 locale in 13-CURRENT branch, so I'd like to try to backport that into my current system.

I'd like to ask some experienced user on advice of how to do that smoothly. (Or I'll post a self-answer when I've tried and achieved it myself).

In essence: How do I backport a locale from a different version of FreeBSD?

  • I'm wondering if copying the appropriate directory under /usr/share/locale/ from a FreeBSD 13-CURRENT system is all you need... – filbranden Nov 30 '18 at 5:36
  • Also, I'll need to make that the default locale for root and some other people. The name of the locale is different: "C.UTF-8" vs "C". So I'm just trying now. – DannyNiu Nov 30 '18 at 5:38
  • Yeah, if copying it works, then just update /etc/login.conf to make it default... Looks like you're getting there, hopefully you'll find the solution, please post it as an answer! – filbranden Nov 30 '18 at 5:39
  1. Get the 13-CURRENT base.txz on your system, extract it to where convenient.

  2. Copy ./usr/share/locale/C.UTF-8 to the root system's /usr/share/locale using cp -R command.

  3. In sh execute export LC_ALL=C.UTF-8, and you'll be able to use the C.UTF-8 locale.

Note: Setting locale like this did not cause the SSH to be closed as described in the linked question, so it's probably okey to not touch login.conf at all and use the ".profile" method instead which is more clean.

| improve this answer | |
  • Actually, the reverse is the case. login.conf is shell-neutral, and thus cleaner, particularly on an operating system where the C shell is the default for some accounts. .profile is not. – JdeBP Jul 11 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.