On Sun, Nov 28, 2010 at 02:52:22PM -0800, Chip Camden wrote:
> inside rxvt-unicode (urxvt) v9.07 
> 
> and I can't seem to get unicode characters to display properly.  I have:
> 
> set charset="utf-8"

This comes up often enough that it should probably be a FAQ...

First off, don't set charset.  You shouldn't need to, and -- unless
you're doing something very funky and you really, really know what
you're doing -- having to do this means your environment is not set up
properly.  Most likely, setting this manually will only work against
you.

Make sure your LANG environment variable (or its many cousins) is
properly set to a UTF-8 locale.  For example, this is my environment
(on a redhat-ish system):

  $ locale
  LANG=en_US.UTF-8
  LC_CTYPE="en_US.UTF-8"
  LC_NUMERIC="en_US.UTF-8"
  LC_TIME="en_US.UTF-8"
  LC_COLLATE=C
  LC_MONETARY="en_US.UTF-8"
  LC_MESSAGES="en_US.UTF-8"
  LC_PAPER="en_US.UTF-8"
  LC_NAME="en_US.UTF-8"
  LC_ADDRESS="en_US.UTF-8"
  LC_TELEPHONE="en_US.UTF-8"
  LC_MEASUREMENT="en_US.UTF-8"
  LC_IDENTIFICATION="en_US.UTF-8"
  LC_ALL=

Note that values in quotes are "inherited" from the $LANG environment
variable, and those without quotes are directly set.  Also note that
this all needs to be done *BEFORE* whatever launches your rxvt windows
starts; e.g. if you're using some window manager gizmo to launch your
windows, it needs to be done before the window manager starts.  This
may mean you need to set the system-wide default to a UTF-8 encoding,
or hack your start-up scripts, depending on what system you're running
on, and how its X startup stuff works (or doesn't).

Next, you need to make sure you're using a proper font that has all
the UTF-8 glyphs.  I'm not familiar with rxvt's font configuration,
but the font you listed may or may not have them... strikes me it
wouldn't, depending on what you're trying to see.  Until I became too
lazy to not use whatever my system provided as its default terminal
window, I configured my xterm with this font:

  -misc-fixed-medium-r-semicondensed-*-13-*-*-*-*-*-iso10646-*

In the past I had to install some unicode font package to make sure
this font was present; these days I don't recall having to do that,
but it's been a while since I installed a fresh system.  This font is
(or should be) the "universal unicode" font, which contains very
many of the Unicode glyphs, including most for asian character
support.

In any event, if your locale settings ($LANG) is set properly, and
your terminal window is using proper fonts that contain the glyphs you
want to display, Mutt should "just work" without you having to set
*anything* in Mutt's config.  Oh, also... if you hand-compile Mutt,
you probably need to make sure you're compiling against ncursesw(-dev)
instead of ncurses(-dev) for Unicode to work properly (note the 'w' at
the end).

These days I use gnome-terminal primarily, which uses newer font
rendering libraries (bonobo, I believe) to magically guess which fonts
contain characters for the charset you're trying to display.  In some
sense this is "better" because you don't have to futz with stuff to
get any given subset of unicode characters to display properly; though
when you end up with a font that you hate for some sub-charset you
use, figuring out how to fix that can be very painful. :(  On the
whole I still prefer xterm, but I haven't ever figured out how to make
its modern font-rendering features work in a way that's "nice", and
the bitmapped fonts really don't look as good IMO, so I gave in and
reluctantly switched.  

I'm not ranting, per se...  I mention this mainly because if you
struggle to get this working, and if there's no strongly compelling
reason for you to stick with rxvt, then you may find that switching to
a more modern terminal emulator solves your problem rather
immediately.  Maybe you care, maybe you don't.

I hope at least some of this was helpful. =8^)

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgpQXxB7ncOp3.pgp
Description: PGP signature

Reply via email to