One way to set a user’s locale and charset is to:
- create a new login class,
- set the login class’s locale and
- set the user’s login class as the newly created class.
Example: Setting petur‘s locale and charset to en_GB.UTF-8 and UTF-8, respectivly.
Append the following to /etc/login.conf
danishKeyboard|Users with a Danish Keyboard:\ :charset=UTF-8:\ :lang=en_GB.UTF-8:\ :tc=default:
Update the capability database by executing cap_mkdb /etc/login.conf.
Set danishKeyboard as petur‘s login class by executing pw user mod petur -L danishKeyboard.
Finally, log in as petur and confirm that the locale has been correctly set as well as that the console correctly displays UTF8 characters.