LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 09-20-2014, 02:14 AM   #1
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
OpenBSD unable to display Chinese.


I am asking this noob question here, because if I asked it on a BSD forum, virtual rocks would be hurlded at me. I am having trouble getting my system to display Chinese characters. I have not yet tried to add anything manually. So they are not in a new directory that requires updating the fontpath. I used pkg_add to install Chinese founts from the OpenBSD package list, so they were installed in existing directories. fs-list shows they are installed, but the system is unable to display them. According to documentation, founts added from the repository should be enabled automatically. Since they were not, I ran:
Code:
/usr/X11R6/bin/fc-cache -v
The result is:
Code:
/root/.fontconfig: not cleaning non-existent cache directory
/usr/X11R6/bin/fc-cache: succeeded
Still nothing. Since I am new to the system, I am probably missing one or two very small steps. Any ideas would be appreciated. /root/.fontconfig: not cleaning non-existent cache directory catches my eye. Suggestive of something being missed in the procedure?
 
Old 09-20-2014, 02:55 AM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Randicus Draco Albus View Post
I am asking this noob question here, because if I asked it on a BSD forum, virtual rocks would be hurlded at me. I am having trouble getting my system to display Chinese characters. I have not yet tried to add anything manually. So they are not in a new directory that requires updating the fontpath. I used pkg_add to install Chinese founts from the OpenBSD package list, so they were installed in existing directories. fs-list shows they are installed, but the system is unable to display them. According to documentation, founts added from the repository should be enabled automatically. Since they were not, I ran:
Code:
/usr/X11R6/bin/fc-cache -v
The result is:
Code:
/root/.fontconfig: not cleaning non-existent cache directory
/usr/X11R6/bin/fc-cache: succeeded
Still nothing. Since I am new to the system, I am probably missing one or two very small steps. Any ideas would be appreciated. /root/.fontconfig: not cleaning non-existent cache directory catches my eye. Suggestive of something being missed in the procedure?
I am not on my own BSD at the moment, but having recently fought my own font battle on a Slackware system I am going to guess that this is actually OK:

Code:
/root/.fontconfig: not cleaning non-existent cache directory
/usr/X11R6/bin/fc-cache: succeeded
The /root/.fontconfig doesn't exist because you have not added any fonts to the root home directory, but it is set in the /usr/local/etc/fonts/fonts.conf by a <dir>~/.fonts</dir> element. I have that and a few other messages on my Slackware box, no harm done.

The next line, /usr/X11R6/bin/fc-cache: succeeded indicates that it is done, but it didn't look anywhere else, although it might with "-f". Otherwise I'd look in /usr/local/etc/fonts/fonts.conf (going by FreeBSD docs) and see if the other paths are enabled.

One last thing is that I think you have to add those to your xorg.conf for them to be available. For example I use Russian on some of my system and I have to add (Slackware path)...

Code:
 FontPath     "/usr/share/fonts/cyrillic"
... into my xorg.conf for those to be picked up. I think that was the same on the BSDs.

I'll check my FreeBSD machine later today.

*** Updated ***

You should also read the FreeBSD Handbook - Localization - probably a big piece of the puzzle!

Last edited by astrogeek; 09-20-2014 at 03:22 AM. Reason: tpos, typs, typos..
 
Old 09-20-2014, 03:44 AM   #3
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
One last thing is that I think you have to add those to your xorg.conf for them to be available.
Which will be easy if they are all in the same sub-directory. Unfortunately, /usr/X11R6/lib/X11/fonts has nine directories. That could easily mean hunting downs all of the new files.

Upon re-reading one piece of documentation, the answer may lie with sysmerge. I need to read the man page carefully before trying it. So it may be a day or two before I have an update.
 
Old 09-20-2014, 07:37 PM   #4
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
It looks like I was wrong about using sysmerge.
Quote:
When you modify a system supplied configuration file, you must manage upgrades to it via sysmerge(8).
Such as /etc/X11/xinit/xinitrc-------------
However,
Quote:
sysmerge is a ksh(1) script designed to help the administrator update configuration files after upgrading to a new release or snapshot.
So I am doubtful about its appropriateness when adding regular packages from the repository. Regardless, I have been looking in the wrong direction. I ran
Code:
xset fp rehash
even though,
Quote:
This is generally only used when adding new fonts to a font directory (after running mkfontdir to recreate the font database).
I do not know if doing so had any effect, but the situation is thus: Chinese is not displayed in applications like file manager and image viewer. "_____" are displayed, instead of characters. However, when an .odt file is opened with LibreOffice, Chinese is displayed perfectly. (I cannot input anything, because Ibus is not working, but that is another issue.) So LibreOffice displays them, but nothing else does.

The new founts are in /usr/local/lib/X11/fonts. I have tried using xset, but:
Code:
 To set the font path:
     fp= path[,path...]
is giving me a headache. Either I cannot figure out the exact syntax to set the path or I am using the wrong command. I have not tried re-booting after trying a few permutations of the command, because it should not be necessary.
Quote:
If X won't find the font path when it boots, you can add it to xorg.conf. But that will only take effect next time you start X. You can also update/manage font paths on-the-fly (meaning, while X is already running, not working on an insect or anything) by using the various fontpath options (fp) of xset(1).
This is starting to bug me. I am very close, but cannot step over the finish line.

Last edited by Randicus Draco Albus; 09-20-2014 at 07:40 PM.
 
Old 09-22-2014, 10:32 PM   #5
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
The problem has been greatly narrowed down. I re-installed the system a couple days ago, so nothing I did previously is a factor. I have discovered that the problem is with the file manager. In this case PCmanFM. I installed Chinese founts from the repository and they were automatically made available, as they should be. They are displayed in text files and I can input Chinese using UIM in applications like LibreOffice and Leafpad. However, the file manager cannot display Chinese. I shall poke around PCmanFM's configuration files for a clue and test other file managers, but on the last installation the Gentoo file manager was not displaying the characters either. If I can find a solution somewhere in the file manager's configuration, I would be able to make the thread as solved.

(If this was a Linux system, I would enable multiple locales, but from what I can make of documentation, that is not possible with OpenBSD. The closest is to set user locales in .profile. Perhaps something else to tinker with later.)
 
Old 09-22-2014, 11:29 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
I am a little relieved to know it is the one application and not the system - I thought I understood the basics but was beginning to wonder...

It does appear that Chinese character sets are a bit of a special case, but still well documented I think.

Keep us posted!
 
Old 09-23-2014, 05:28 AM   #7
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Well how does one enable multiple locales in a Linux system? In the kernel?

If not what package do you need in order to do that?
 
Old 09-23-2014, 06:03 AM   #8
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
Originally Posted by cynwulf View Post
Well how does one enable multiple locales in a Linux system?
With Debian I used either dpkg-reconfigure locales or dpkg reconfigure-locales. I forget which. With OpenBSD I have seen directions for user-specific settings in ~/.profile. At the moment, everything else is working peachy, so I am in no hurry to experiment. Maybe in a day or two.
 
Old 09-23-2014, 06:42 AM   #9
cynwulf
Senior Member
 
Registered: Apr 2005
Posts: 2,727

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
"dpkg-reconfigure" is a fancy Debian/dpkg specific script which just reinstalls/reconfigures a package with different settings. That is not really "multiple locales". The locales package just automatically configures everything for you. In OpenBSD you will have to do this manually. I don't really understand what it is which you require nor how to go about setting it up for that matter.
 
Old 09-23-2014, 07:04 AM   #10
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
I do not know if I need to. It is something I am keeping abreast of, in the event I cannot get the file manager to display characters. I have found documentation where people have solved such problems by creating two user profiles with different locales. This method will be my fallback if nothing else works.
 
Old 09-28-2014, 03:45 AM   #11
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
I would not rule out a problem with the program. Some programs (Almquist shell for example) just don't accept Unicode characters.

In Xlib, the default character encoding is Latin-1. You have to use multi-byte functions and FontSets to get UTF-8. It could be that the program doesn't bother with FontSets, or that it naively assumes that 1 byte = 1 character (when you read input, you have to take into account that a single character may be composed of several bytes, but the programmer could have missed that). Furthermore the program must call setlocale properly. It could be that all your other programs look at $LANG to guess what your language should be in case LC_CTYPE is not set, but the file manager doesn't and so isn't able to set the locale. However, all of that must be debugged by looking at the source code. You could try setting LC_CTYPE.

The encodings are important. ASCII and Latin-[anything] are definitely unable to display Chinese. Are you using UTF-8 or Big-5, and what does the program expect?

If all else fails you should ask the developers. Chances are they never tested the program with Chinese characters. If it is a bug they will be glad you reported it. Developers are nice and helpful people, unlike BSD users.

Quote:
I am asking this noob question here, because if I asked it on a BSD forum, virtual rocks would be hurlded at me.
 
Old 09-28-2014, 06:27 AM   #12
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
Originally Posted by Soderlund View Post
Are you using UTF-8 or Big-5
big5/gb truetype and kcfonts; "a suit of chinese Ming Fanti fonts for X window." The package description does not say if UIM includes its own, so I need to dig around to find out.
Quote:
and what does the program expect?
All I know is that PCmanFM had no trouble with Debian and Slackware. I do not know if there is a difference in application programming or simply a difference in where the application looks for languages. Thanks for the idea. I shall root around when I have time. I am still using the default locale setting, which I believe is en_US, ASCII or ISO8859-1. I just got home from work and am a little brain-dead at the moment, so I cannot remember the location of the locale file. Setting the locale to en_GB.UTF-8 is usually one of the first things I do, but I have not dared yet to do it this time. Sometime tomorrow when I am clear-headed I shall check the locale setting and change it if it is not UTF-8.
 
Old 09-28-2014, 07:40 AM   #13
Soderlund
Member
 
Registered: Aug 2012
Posts: 185

Rep: Reputation: 81
Does it work if you start it from a terminal like this?

Code:
LC_CTYPE=$LANG pcmanfm

LC_ALL=$LANG pcmanfm
What is the output of the following?

Code:
env | grep 'LC_'
echo $LANG
 
Old 10-06-2014, 07:57 PM   #14
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
Quote:
Originally Posted by Soderlund View Post
Does it work if you start it from a terminal like this?

Code:
LC_CTYPE=$LANG pcmanfm

LC_ALL=$LANG pcmanfm
No.

Quote:
What is the output of the following?

Code:
env | grep 'LC_'
echo $LANG
Nothing. Which I find disconcerting.

I have made an "interesting" discovery. I have a bunch of files that I named using Debian. The locale was en.GB.UTF-8. PCmanFM cannot read the names, but if I use UIM to "rename" them, the file manager displays the names. Midnight Commander only displays "????," which, I believe is simply a UTF-unicode thing. UIM is able to display non-European scripts in both unicode and UTF. So my current hypothesis is that OpenBSD has limited script (fount/locale) support by default. My guess is, installing more founts and/or input methods might rectify the situation. The problem is figuring out what is needed. Normally my progress thus far would be sufficient, but I do not want to rename hundreds of files. (Not remembering the names of every file is also a little problematic.)
 
Old 10-22-2014, 02:11 PM   #15
Randicus Draco Albus
Senior Member
 
Registered: May 2011
Location: Hiding somewhere on planet Earth.
Distribution: No distribution. OpenBSD operating system
Posts: 1,711

Original Poster
Blog Entries: 8

Rep: Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635Reputation: 635
To my inexperienced mind, this keeps getting more bizarre. I have two sets of backup files on two external hard-drives, apparently factory-formatted to NTFS. The set I have been using are on the drive that I formatted to FAT32 and copyed files to using gparted. Chinese, and a very small number of Japanese, file names are not displayed by the package manager, until I use UIM to remane them. Yesterday I finally got around to the task of formatting the other external drive to FAT and recreating the second batch of backup files, using my OpenBSD system. Not being sure if I should use fdisk or disklabel, I tried disklabel -e. (BSD newbie) Of course it did not work, but after booting the system today, I mounted that second drive and it was accessible with all the files intact, and all of the Chinese and Japanese file names are diplayed! Of course Ranger and Midnight Commander cannot display the Chinese names, but PCmanFM can. So apparently the issue has nothing to do with founts, input methods or file managers, but with USB formating (incorrect disc labelling?). Obviously I need to re-read the manual regarding formatting USB devices, but apparently I blindly stumbled upon the cause and solution of this problem.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] where to set to display chinese chinese characters vitalstrike82 Slackware 4 11-17-2012 02:38 AM
How to display Chinese in Linux dragondeer Red Hat 1 07-31-2008 05:16 AM
display chinese in gnome NanoFxJ Linux - Software 4 03-27-2005 09:54 PM
could not display chinese so-fish Linux - Software 8 06-04-2004 06:44 PM
Can't display Chinese in Slackware 9.0 GrimCracker Slackware 15 10-22-2003 08:03 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 10:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration