WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to display Chinese (Unicode) in urxvt.  (Read 7061 times)

Offline solorin

  • Full Member
  • ***
  • Posts: 184
How to display Chinese (Unicode) in urxvt.
« on: April 06, 2012, 03:03:32 PM »
Following some hints and suggestions around the forum.

I've gotten bitmap fonts from xfonts-wqy.tcz (Thank you, syun) working, at least to the extent that xlsfonts returns the proper font name. They don't seem to work out of the box for me so I copied one size to ~/.fonts, ran mkfontscale and mkfontdir(from Xorg-7.6-bin.tcz)  in .fonts, then xset +fp ~/.fonts && xset fp rehash.

I loaded the extensions locale-col-zh (Thanks david.w!) and urxvt-daemon (thx peterc) from the repository.

Then, urxvtd -q -o -f @ shell prompt to start urxvtd as per the info file.
And then I called urxvtc -fn "font-name-from-xlsfonts-i'm-to-lazy-to-type-now".
I get a new terminal window (yay!) at that prompt I export LANG='en_US.utf8' or export LANG='zh_TW.utf8'.

Then I try and display some unicode texts from the web I downloaded.

... and no joy.

If anyone can give clear instructions on how to get this working, I'll write it up on the wiki, so people can start documenting other localization HOWTO's.

Thank you.

cheerio,
solorin
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11702
Re: How to display Chinese (Unicode) in urxvt.
« Reply #1 on: April 06, 2012, 03:36:54 PM »
Hi solorin
urxvt.tcz  lists  Xorg-7.6-lib.tcz  as a dependency. Maybe  urxvt-daemon.tcz  requires it too?

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: How to display Chinese (Unicode) in urxvt.
« Reply #2 on: April 06, 2012, 03:41:26 PM »
I use Xorg-7.6-lib for dwm and dmenu so I have that loaded already. I don't know if it's a dependency, because I haven't loaded it without. It does ask for fontconfig tho, and I've loaded that up as well.
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11702
Re: How to display Chinese (Unicode) in urxvt.
« Reply #3 on: April 06, 2012, 06:08:20 PM »

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: How to display Chinese (Unicode) in urxvt.
« Reply #4 on: April 07, 2012, 02:01:28 AM »
Thanks Rich for your persistent and earnest help.

Yes, I read that thread before I started this one.
So I thought maybe it was tool support. (vim/cat/less not supporting unicode)
but I just compiled w3m with unicode support and

still no joy.

urxvt keeps complaining it can't find a termcap entry for rxvt-unicode.
and I've been setting TERM to rxvt.

does anyone know where I can find or generate the termcap or terminfo?

Thanks.
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: How to display Chinese (Unicode) in urxvt.
« Reply #5 on: April 10, 2012, 01:16:27 AM »
So I managed to install the terminfo entry into ~/.terminfo/ by executing tic (from ncursesw-utils.tcz) on the terminfo file provided in the upstream sources.

then,
tce-load -i locale-col-zh.tcz
tce-load -i urxvt-daemon.tcz
tce-load -i xfonts-ffs.tcz (puts bitmap fireflysung fonts into /usr/share/fonts/firefly)
xset +fp /usr/share/fonts/firefly
xset fp rehash
urxvtd -q -o -f
urxvtc -fn firefly16 -tr +sb -vb -fg white

move to the newly spawned terminal.
export LANG='zh_TW.utf8'
w3m test.zh.utf-8

but it's still an unreadable mess.

I feel like I'm groping around in the dark for a small missing piece.
There must be other tinycore users who can display international characters in
urxvt. Would somebody be so kind to enlighten me?

Thanks,
solorin
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: How to display Chinese (Unicode) in urxvt.
« Reply #6 on: April 11, 2012, 12:15:08 AM »
Ok. I'm pretty sure it's unicode/multi-byte support in various programs.

I managed to configure w3m some more and finally got some results. It displays chinese characters. However, they are not intelligible, and despite my chinese being rudimentary at best, AFAICT it's still not displaying the correct text. I think I might I have to recompile w3m or dig through some more w3m documentation (oh joy).

I was disappointed to find that vim was compiled without multi-byte support. But from packaging other extensions I know that given a long list of compile options, you try and prune them for a compact useful extension. (Vim also has a ton of options. Even thinking about rebuilding a private extension makes me shudder.) Unicode support and the like are likely some of the first things to go, as stock Core doesn't have good support for it anyway.

But if you do make an extension with unicode support and you don't already do it, can I ask extension packagers to add 'unicode' into their list of tags when they next update? That would help users looking for support find it quickly and conveniently.

Thanks all.

cheerio,
solorin
« Last Edit: April 11, 2012, 12:18:01 AM by solorin »
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----

Offline solorin

  • Full Member
  • ***
  • Posts: 184
Re: How to display Chinese (Unicode) in urxvt.
« Reply #7 on: April 26, 2012, 08:55:29 AM »
http://www.cl.cam.ac.uk/~mgk25/unicode.html

ok, silly me. it sez here, cat and echo work on streams, so unicode should display fine.
and also that less should be unicode aware out of the box.
I tried with busybox cat and coreutils cat
no go.
and also with the busybox less, and the full version.
nada. zilch.

i really don't understand why this isn't working.

i'm also really skeptical that there isn't at least one other tinycore user
who's been able to get  this working or wants to get this working.

am i posting in the wrong language? I feel like I'm taking crazy pills here.

cheerio,
solorin
« Last Edit: April 26, 2012, 09:01:50 AM by solorin »
. . . if you don't know, now you know. . .
        ----- R.I.P. Biggie Smalls -----