Solved I see boxes with numbers inside instead of japanese/asian characters

Good day,

I always see these boxes when I browse for websites with japanese in it, same as goes for chinese and other asian languages.
1756725783419.png
1756725853599.png


It seems that my FreeBSD doesn't support asian languages. I already browsed and followed the handbook regarding on adding japanese, but it won't work.
Chapter 25. Localization - i18n/L10n Usage and Setup

Here is what I did:
Code:
$ doas nano /etc/login.conf

# added the japanese language at the end
japanese|Japanese Users Accounts:\
         :charset=UTF-8:\
         :lang=ja_JP.UTF-8:\
         :tc=default:

# ran this command after for changes to take effect
$ doas cap_mkdb /etc/login.conf

Here is my locale output:
Code:
$ locale
LANG=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_TIME="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_ALL=

Looking for your assistance, thank youu!!
 
FreeBSD supports it, after all those are all just UTF-8 characters. The problem are the fonts that often only include characters for roman languages.

You'd have to install a font like e.g. x11-fonts/noto-hk that have the actual symbols for chinese characters. (or just install the full x11-fonts/noto meta-package)
 
Code:
$ doas nano /etc/login.conf

# added the japanese language at the end
japanese|Japanese Users Accounts:\
         :charset=UTF-8:\
         :lang=ja_JP.UTF-8:\
         :tc=default:

# ran this command after for changes to take effect
$ doas cap_mkdb /etc/login.conf
So, this won't be necessary?
 
Possibly simply installing fonts wit CJK gryphs is NOT sufficient (works in many cases, but not assured to be always). In these cases, you need to specify any font actually having CJK gryphs you need (noto-hk as already noted by sko, and for example, you may want japanese/font-std and some others for Japanese).

Fonts in X/Wayland and base vty are different.
I've never tried others, but you may want Ed Maste's b16.fnt here to read Japanese texts in vtys.

My configuration in my /etc/rc.conf to use b16.fnt is as follows. Assuming it is copied into /usr/share/vt/.
sh:
if [ -r /usr/share/vt/fonts/b16.fnt ] ; then
    allscreens_flags="-f /usr/share/vt/fonts/b16.fnt"
fi
 
Code:
$ doas nano /etc/login.conf

# added the japanese language at the end
japanese|Japanese Users Accounts:\
         :charset=UTF-8:\
         :lang=ja_JP.UTF-8:\
         :tc=default:

# ran this command after for changes to take effect
$ doas cap_mkdb /etc/login.conf
So, this won't be necessary?
only if you want to set the system language for that user to japanese.


edit: I somehow assumed chinese in my answer even if japanese was asked. the appropriate noto sub-font for japanese would be x11-fonts/noto-jp.
 
vmisev, thanks for mentioning the page. There's a FreeBSD section on it. I'm usually ok once I install noto-jp. But if you also need Chinese, the noto-hk might be the better choice. You can try pkg search noto |grep <whatever lanaguge you're looking for. You should probably do grep -i--for example, grep chinese gives nothing, grep -i chinese gives several.
 
vmisev, thanks for mentioning the page. There's a FreeBSD section on it. I'm usually ok once I install noto-jp. But if you also need Chinese, the noto-hk might be the better choice. You can try pkg search noto |grep <whatever lanaguge you're looking for. You should probably do grep -i--for example, grep chinese gives nothing, grep -i chinese gives several.
You are welcome, I always try to direct people to the best article about subject related to FreeBSD that I know of. BTW, link I posted goes straight to #FreeBSD.

BTW, I love to have all possible noto fonts installed (and then some more), I just hate when I click on Wikipedia “Read Wikipedia in your language” and see bunch of ▯▯▯▯▯▯ for any language 🤷‍♂️
 
Back
Top