xkb multibyte characters input problem
I just posted in bsdforum, but found out most people moved here.
> Hello folks,
> this time before writing I took my very long time to study and read and try hard to solve it myself, but I'm still stuck.
> Please help
> I really want get rid of Windows, but before I can do it I need all the multilanguage functions it has, it is a must for me.
> I don't care about a full locale, but I need to get multi-bytes carachers input and display.
> At the same time I don't want to have a Windows-like gui, so, no KDE, no GNOME (I guess a lot of my problems would be already solved with them).
> I'm running OpenBSD 4.3 on a laptop (HP Omnibook 900b). I'm sticking to OpenBSD because in my very (VERY) numerous installs to try out what's best for me, the only one that went really smooth and where everything (hardware-wise) works is OpenBSD.
> I'm running: Ion3 as a window manager, Mlterm as terminal, Mined as an editor for multi-language scripts, w3m as a browser, Pidgin for chats, Alpine for imap emails, Postgresql for database (MS Access has screwed up my tiny database, one of the reasons why I'm in a rush to switch. And for my little problem with postgres, see my other thread).
> So, what's the problem?
> First problem:
> I managed to get chinese characters display and input also in terminal, but filenames in chinese are not displayed even after using "convmv" to get them all to utf-8(the encoding I'm using mlterm with), that is, they get displayed by convmv but then disappear again if I do "ls".
> But, strangely enough, if I know the filename I can type it in and get it recognized and opened. Actually, this is not the biggest problem, I'd be ready to change all my filenames to latin letters.
> Second problem:
> I'm using xkb to switch keyboard layouts, but once switched the characters don't work in terminal (that is, after switching keyboard, typing results in no response for russian, and in funny garbage for accented characters), But they work in Firefox in the Google search. So it is probably a misconfiguration of mine, but I've tryed them all without success. The same problem applies to w3m and alpine, where I can input chinese but not cyrillic or accented characters.
> Here is the sections of xorg.conf that might help ("wqy" is wenquanyi, chinese bitmap font, very nice):
> Section "Files"
> RgbPath "/usr/X11R6/share/X11/rgb"
> ModulePath "/usr/X11R6/lib/modules"
> FontPath "/usr/X11R6/lib/X11/fonts/misc/"
> FontPath "/usr/X11R6/lib/X11/fonts/wqy/"
> FontPath "/usr/X11R6/lib/X11/fonts/cyrillic/"
> FontPath "/usr/X11R6/lib/X11/fonts/TTF/"
> FontPath "/usr/X11R6/lib/X11/fonts/OTF"
> FontPath "/usr/X11R6/lib/X11/fonts/Type1/"
> FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
> FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
> FontPath "/usr/local/lib/X11/fonts/ghostscript/"
> FontPath "/usr/local/lib/X11/fonts/mscorefonts/"
> Section "Module"
> Load "GLcore"
> Load "dbe"
> Load "extmod"
> Load "glx"
> Load "record"
> Load "xtrap"
> Load "freetype"
> Load "type1"
> Section "InputDevice"
> Identifier "Keyboard0"
> Driver "kbd"
> Option "XkbRules" "xorg"
> Option "XkbModel" "pc101"
> Option "XkbLayout" "us,it,ru(winkeys)"
> Option "XkbOptions" "grp:lwin_toggle"
> Option "XkbVariant" "nodeadkeys"
> Here is Mlterm configuration files:
> ENCODING = UTF-8
> input_method = uim
> scrollbar_view_name = simple
> line_space = 1
> ISO10646_UCS4_1_BIWIDTH=-wenquanyi-wenquanyi bitmap song-medium-r-normal-*-12-120-75-75-p-*-iso10646-1:120;
> set convert-meta off
> set input-meta on
> set output-meta on
> # $OpenBSD: dot.profile,v 1.4 2005/02/16 06:56:57 matthieu Exp $
> # sh/ksh initialization
> export PATH HOME TERM
> export PKG_PATH=ftp://ftp.kaist.ac.kr/pub/OpenBSD/4.3/packages/i386/:ftp://ftp.btradianz.se/pub/OpenBSD/.../packages/i386/
> export GDK_USE_XFT=0
> set +o emacs-usemeta
> I hope I did not forget anything
> Thank you in advance.
The operating system locale is different from the X locale.
So, if you chose utf-8 in X, and if your applications support utf-8, you should have no problem re-reading the the filenames correctly with another application supporting utf-8.
On xterm or on the CLI, when you ls, you will read the names of the filesystem in a 8-bit raw format.
This is ASCII-7bit, which is a subset of utf-8, and and 8th bit containing extended characters. These depend on the OS set locale (.profile, .login, ... etc).
From stock, X (and xenocara) now include luit (man luit) which act as a filter between two character sets. Could help you, even on the CLI.
Also, xterm can be called as uxterm for unicode environments.
Many other graphical terminals are Unicode and|or UTF-8 aware.
Basically, if you stay under a window manager with utf-8 aware applications, your display should be correct.
Here are some links to utf-8 patches (OS and file system)
If you use GNOME
The xkb definitions now are under /etx/X11/xkb but gnome seems to be searching under
you might need to
ln -s /etc/X11/xkb /usr/X11R6/lib/X11/xkb
the get the keyboard indicator applet
Just rememner that OS and file system locales are different from Xorg and xlocales.
da more I know I know I know nuttin'
Thanks for you long answer.
I really did not know the system locale is different from the one in X.
And where should I set it? In .xinitrc?
I knew about citrus, I tried it many times, but something always went wrong. This machine is slow and it takes a whole day to rebuild, so I'm not going to try that again.
To tell the truth, I still did not understand what I should do exactly.
And actually in the first post I did forget something. I can only input filenames in chinese in bash, and not in ksh. But no russian there also.
Last edited by gosha; 8th June 2008 at 11:40 PM.
usually set system wide in /etc/login.conf
for users, in their ~/.profile
Note for ksh
FAQ 8.16 - ksh(1) does not appear to read my .profile!
ls -d /usr/share/locale/zh*
Normally in ~/.Xdefaults
ls -d /usr/X11R6/share/X11/locale/zh*
This said, I have no way to check if a /usr/share/locale/zh_TW.eucTW
can be filtered into a /usr/X11R6/share/X11/locale/zh_TW.UTF-8
as you did for mlterm
for each X application, most of the time the application itself can set the encodings (thunderbird, firefox, gnumeric, gedit, ...).
Other times, the application has a dot file or directory.
I like the small wrapper scripts they give as example.
Not tested but .xinitrc being a list of shell commands, it should be possible to setenv or env to a locale.
I assume you would get better answers on Chinese OpenBSD forums
da more I know I know I know nuttin'
Thanks again, I'll give it a try now.
Actually, the main problem for me is not Chinese, because I can still make an alias for ls and get my filenames: (ls | iconv -f gb2312 -t utf-8 *). And by the way, I tried to download pfm, and it displays correctly the filenames in chinese converted to utf-8, so either I'm misconfiguring mlterm, either there's something wrong with it.
My biggest problem, the one I cannot resolve, is my cyrillic input through xkb. Where's the problem in my configuration? I need to input cyrillic and accented characters in terminal (basically, for Alpine and psql).
GNOME has the keyboard switcher applet,
Xfce has one, but does not switches: use the keymap of the xorg.conf,
KDE? never tried but almost sure there is a setting somewhere.
These WM applets should take precedence over other choices.
In any case, I would use, as an extra, the ~/.Xdefaults tip from the FAQ.
Have been reading
about the layout lists in
found no answer but
da more I know I know I know nuttin'
Last edited by lvlamb; 9th June 2008 at 03:28 AM.
|Thread||Thread Starter||Forum||Replies||Last Post|
|Input foreign characters under X11||Beastie||General software and network||5||30th August 2009 12:51 PM|
|sorting special characters||gosha||Programming||15||9th April 2009 03:29 AM|
|Username longer than 16 characters||_hmp_||FreeBSD General||5||13th January 2009 10:01 AM|
|C and file input/output||18Googol2||Programming||3||20th August 2008 05:02 PM|
|shell script with input||c0mrade||Programming||5||13th July 2008 05:33 AM|