[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

character codes for terminals



Hi,

I am interested in I18N.

Recently more and more softwares come to support UTF-8.  One
of the significant softwares is Xterm, which supports multicolumn
and combined characters for eastern-Asian and Thai.  Wow!

I think a few (or more) years since now will be a transit period
from conventional character codes to UTF-8.  During the period,
we will have both UTF-8 enabled softwares and other softwares.
Of course we may need conventional character codes in future
after we will have finished to transit into UTF-8.

One problem is the environmental softwares such as X terminal
emulator and so on.  Console softwares which run on X terminal
emulators, Linux console, and special consoles such as kon and
jfbterm have no method to get which character code is supported
by the environment.

It may be responsible for users' own setting of LANG, OUTPUT_CHARSET,
LESSCHARSET, and so on.  However, I would like to write a .bashrc
file which is sensible to the environment itself and set LANG variable
and so on.

TERM variable may be used for this purpose.  For example, my 
.bashrc has the following lines:

----------------------------
if [ "$TERM" = "linux" -o "${TERM%-*}" = "xterm" ]
then
  LANG=C
  OUTPUT_CHARSET=ISO-8859-1
  JLESSCHARSET=latin1
else
  LANG=ja_JP.eucJP
  OUTPUT_CHARSET=EUC-JP
  JLESSCHARSET=japanese
fi
export LANG OUTPUT_CHARSET JLESSCHARSET
----------------------------

However this method is not universal and can fail for some
X terminal emulators.  Rather, this script is only valid for
a limited range of terminals which I often use (xterm, kterm, 
krxvt, Linux console, kon, jfbterm, shell mode in emacs).

Are there any standardized method which can be used for this purpose?
It can be not implemented to Debian yet; I can propose a Debian
Policy to implement that.

I think not only Japanese people but also European language speakers
will benefit from this method.

Any comments?

---
Tomohiro KUBOTA <kubota@debian.org>
http://surfchem0.riken.go.jp/~kubota/



Reply to: