[vox-tech] vim and utf-8 support (newbie alert)

Peter Jay Salzman vox-tech@lists.lugod.org
Tue, 10 Jun 2003 00:56:11 -0700


On Mon 09 Jun 03,  5:05 PM, Ken Bloom <kabloom@ucdavis.edu> said:
> 
> Here is what I have found from a bit of research now. running uxterm or 
> runnning xterm -u8 makes the xterm support data in both directions 
> (input and output) that is encoded in hebrew. With that, select a font 
> for the xterm that is encoded in iso10646-1. There should be lots of 
> good choices, you can check them out using xfontsel.
 
i set xfontsel to

   *-*-*-*-*-*-*-*-*-*-*-*-iso10646-*

and got the message that 1022 font names match.  looking at the
families, there are only about 30 families including arial, times new
roman, and verdana.   i recognize alot of MS core TT font names.

just to try something, i did:

   xterm -u8 -fn "-*-times new roman-*-*-*-*-*-*-*-*-*-*-iso10646-*"

sure enough, after following the directions you outline below, i was
able to type hebrew in an xterm.  wasn't perfect (i had access to vowels
as long as i used a 10646 font, but they replaced the consonant rather
than modifying the consonant.  i think i need to read henry's email a
bit and see that helps.

but it was pretty cool to see.  :)

> I observed that for some reason the culmus fonts can't work as iso10646 
> in xfontsel or xterms, but they can handle it just fine in pango 
> applications. Perhaps that's a bug in the debian packaging of these 
> fonts (perhaps not having fonts.dir entries for iso10646-1) - I haven't 
> filed a bug on this though, so someone else can if they think it's a 
> bug.

i noticed the same thing.  i'd file the bug report myself if we can find
an unequivocal example of a unicode font that isn't usable on a uxterm.

i would imagine the culmus fonts are unicode, but how can we make sure?

> Inside the xterm, run vim -H (or just run vim and :set rl this won't 
> change vim's keyboard layout, so it will let you type english too, 
> although it wll be backwards) and set its encoding to utf-8 as per the 
> directions that we have already discussed:
> :set encoding=utf-8
> 
> Set up your X keyboard according to instructions included at 
> http://imagic.weizmann.ac.il/~dov/Hebrew/pango-hebrew.html
> A diagram of the keyboard layout is available at that site.
> 
> Hit right-alt once to toggle to hebrew and start typing. When you save 
> your work, the result will be a utf-8 encoded file.
> 
> As an added bonus, applications that support pango (and this includes 
> the standard text boxes in GTK+ 2.x, gaim conversations, AbiWord, and 
> more) will also allow hebrew input using the same right-alt language 
> switch.
 
awesome!  just as long as i remember to hit alt a second time.  i had to
kill mutt a few times before i remembered to hit alt again.  :-)

> From the looks of things, Vim's keyboard layouts also appear to 
> support vowels when you're working in UTF-8, but I don't know what keys 
> you have to press to get them. They have the advantage of having some 
> kind of phonetic layout (pete, can you confirm this for me?), but the 
> disadvantage of only working in vim.

yeah -- there appears to be a few:

/usr/share/vim/vim61/keymap/hebrew_iso-8859-8.vim
/usr/share/vim/vim61/keymap/hebrew_utf-8.vim
/usr/share/vim/vim61/keymap/hebrewp_cp1255.vim
/usr/share/vim/vim61/keymap/hebrewp_iso-8859-8.vim
/usr/share/vim/vim61/keymap/hebrewp_utf-8.vim

hebrew are keymaps based on a phonetic layout which non native speakers
would be interested in.

hebrewp keymaps are what native speakers would use -- people with
real native hebrew keyboards.

as you point out, they're just vim keymaps.  they don't work with
anything else like xterm or abiword.

now what i *really* would like is a phonetic keymap for X.  if i use a
phonetic keymap for vim and the native keymap for abiword, i shall
surely go insane....

pete

ps- just saw reloaded.  i liked it just like i liked "return of the
jedi": very cool movie, but the magic just wasn't there.  i think the
problem was that they traded suspense for action.   romantic tension for
romance.  the whole movie was "in your face" from start to finish.

like good ingredients to a recipe, they couldn't have made a bad movie.
it just wasn't magical like the first one...

-- 
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D