Normally when reading mail, I run pine in xterm with UTF-8 enabled, and
it works to a certain degree. All output is filtered through iconv(1) in
a simple script based on the message’s character set and converted to
UTF-8 sequences.

Now, if I log onto my machine with a non-UTF-8 terminal program, is it
possible to detect if the terminal emulator understands UTF-8 and
eventually can tell the script (by setting an environment variable) to
convert the output to plain old latin1 instead? I mean something like
this script every message is filtered through:

  #!/bin/bash

  charset=$1

  # (Set $has_utf8 to "1" if UTF-8 capable)

  if [ "$has_utf8" = "1" ]; then
    iconv -f $charset -t utf-8
  else
    iconv -f $charset -t iso-8859-1
  fi

The place I’d like to place the test is where the comment is. Any hope?

Peace and sunshine,
Øyvind
---------------------
cat /dev/urandom >SCO

--
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/

Reply via email to