# localization and character set in console



## mipam007 (Aug 16, 2017)

Hi Forum!

I've spend some nice time to manage FreeBSD 11.1 server and Git repo inside jail with help of pf. Everything is working great and I can reach my git service and utilize it without issue. 

Unfortunately when I run git log, I cannot see all Czech characters correctly. I went through the handbook but I am bit confused and probably didn't understood how to leave system with English environment (manuals, programs, console, keyboard, but to be able to see all middle Europe (Slavic) characters. Can you guys please enlighten me how to achieve this? For example in Linux, I install whole system in English, but there is still possibility to write and read Czech characters in console.

Thanks much!
BTW: I have also tried to search in the forum, so in case that there is something already written about it, be so kind and point me there.


----------



## Minbari (Aug 16, 2017)

You need to set locale correctly.


----------



## SirDice (Aug 16, 2017)

This should help: Handbook: 22.2. Using Localization


----------



## mipam007 (Aug 16, 2017)

OK, thanks for kicking my ass  I did stupid typo in ~/.login_conf

now its working with following settings...!

me:git:\
   :charset=UTF-8:\
   :lang=en_US.UTF-8:

but still, I do not understand, how to achieve that I will be able to read/write e.g. in Chinese, Russian and Czech and still will see all characters... this particular setting allow me to read/write only Czech (and English of course), right?


----------



## SirDice (Aug 16, 2017)

The LANG setting only sets the language, so utilities can use LANG to determine in what language it should run. It's the characterset that makes it possible to print/input characters from different languages. In this respect UTF-8 is probably the best choice as it has a lot of characters from various languages and thus should be able to correctly print Cyrillic characters. It shouldn't have a problem with Chinese either. If you get the characterset correctly, you still need a font that's able to actually show the correct image for a specific character. 

https://en.wikipedia.org/wiki/UTF-8


----------



## mipam007 (Aug 16, 2017)

SirDice said:


> The LANG setting only sets the language, so utilities can use LANG to determine in what language it should run. It's the characterset that makes it possible to print/input characters from different languages. In this respect UTF-8 is probably the best choice as it has a lot of characters from various languages and thus should be able to correctly print Cyrillic characters. It shouldn't have a problem with Chinese either. If you get the characterset correctly, you still need a font that's able to actually show the correct image for a specific character.
> 
> https://en.wikipedia.org/wiki/UTF-8



OK, so in FreeBSD, LANG is doing that thing, that application start to speak in specifics language, that's clear, and this was what I had, and wasn't happy that system starts to speak to me in Czech. What is frustrating, because when your are facing some system issue, and you are googling, you have not much chance to find the answer when you have error message in Czech 

I was confused how to achieve that my console would print all Czech characters (and other languages) without having system localized in Czech. Same belongs to mounted remote file systems.

I would not want to complain it's rather curious question but FreeBSD was always full operating system, not just a kernel, so why there isn't option that all languages are supported by default and you don't have to specifically said in which encoding you need to mount the file system or that you want to open files with Czech or Polish or whatever language?

Thanks for your time!


----------



## SirDice (Aug 16, 2017)

The console is still being worked on, the previous sc(4) console was in quite a need of an update. The new vt(4) console for example supports unicode, sc(4) does not. It's not finished though there are still a few features missing or not working correctly. The change to vt(4) was pushed forward due to various X drivers requiring KMS, which causes all sorts of problems with old console driver.

https://wiki.freebsd.org/Newcons


----------

