KeePass2 shows garbled characters on Linux Mint

eye-catch Other techs

I installed KeePass2 on my Linux Mint.

However, Japanese characters are garbled on KeePass2.

It doesn’t work because the default font is from Microsoft…

    <Family>Microsoft Sans Serif</Family>

Garbled on the entries

It needs to be updated from the following screen.
Tools -> Options -> Interface -> Select List Font

I changed it to TakaoPGothic.

The Title is fixed but the Japanese characters in the search box are still garbled!

Garbled in the search box

fc-match command shows which font is used.

$ fc-match sans
DejaVuSans.ttf: "DejaVu Sans" "Book"

This means that the “DejaVe Sans” is used when “sans” is specified.

In my case, it needs to be set to something else that supports Japanese. I created ~/.config/fontconfig/fonts.conf with the following content.

<?xml version="1.0"?><!--DOCTYPE fontconfig SYSTEM "fonts.dtd"-->
    <match target="pattern">
        <test qual="any" name="family">
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Sans CJK JP</string>

After that, fc-match shows the following.

$ fc-match sans
NotoSansCJK-Regular.ttc: "Noto Sans CJK JP" "Regular"

KeePass2 shows Japanese as expected after the restart.

However, the hierarchy is different from the Windows version… It might not be good to update the database from Linux side… Or, probably I should move the nested folder to the top level.