# How to change localization for a jail?



## olav (Jul 29, 2013)

I have problems getting the nn_NO.UTF-8 locale to work in a jail.

I have read the http://www.freebsd.org/doc/handbook/using-localization.html documentation and by modifying the /etc/login.conf and running the cap_mkdb command on the file, it worked just fine on the host system. However doing the same thing in a jail doesn't work. Are there some additional steps required for a jail?


----------



## SirDice (Jul 29, 2013)

How are you accessing the jail? Keep in mind that if you do something like [cmd=]jail myjail /bin/sh[/cmd] the environment doesn't get loaded. Instead do something like [cmd=]jail myjail /usr/bin/su -[/cmd].


----------



## olav (Jul 29, 2013)

I've tried 

`jexec <jailid> /bin/sh`

`ezjail-admin console`

and regular ssh.


----------



## cpm@ (Jul 30, 2013)

Try `jexec -U root <JID> /bin/sh`


----------



## olav (Jul 30, 2013)

Sorry, neither that did work 

But it seems like I've not configured the host correctly either, because I still cannot write the Ã¸Ã¦Ã¥ characters in vi.

This is what happens in the shell.

```
$ Ã¸Ã¦Ã¥
-bash: $'\303\270\303\246\303\245': command not found
```

So I've not configured it correctly yet. I'm posting what I've done with my /etc/login.conf file

```
default:\
        :passwd_format=sha512:\
        :copyright=/etc/COPYRIGHT:\
        :welcome=/etc/motd:\
        :setenv=MAIL=/var/mail/$,BLOCKSIZE=K:\
        :path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\
        :nologin=/var/run/nologin:\
        :cputime=unlimited:\
        :datasize=unlimited:\
        :stacksize=unlimited:\
        :memorylocked=unlimited:\
        :memoryuse=unlimited:\
        :filesize=unlimited:\
        :coredumpsize=unlimited:\
        :openfiles=unlimited:\
        :maxproc=unlimited:\
        :sbsize=unlimited:\
        :vmemoryuse=unlimited:\
        :swapuse=unlimited:\
        :pseudoterminals=unlimited:\
        :priority=0:\
        :ignoretime@:\
        :umask=022:\
+       :charset=UTF-8:\
+       :lang=nn_NO.UTF-8:
```

Since that didn't work, I've also added the following lines(with sysinstall(8)) to /etc/rc.conf

```
# -- sysinstall generated deltas -- # Mon Jul 29 23:42:15 2013
font8x8="cp865-8x8"
font8x14="cp865-8x14"
font8x16="cp865-8x16"
keymap="norwegian.iso"
```
But it is still not working


----------



## olav (Jul 30, 2013)

I changed encoding from UTF-8 to ISO8859-1, and now it works fine... but I guess that new files I create with vi, will now have ISO8859-1 encoding by default?


----------



## graudeejs (Jul 30, 2013)

[n]vi in base doesn't support UTF-8 as of writing this.


----------

