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

Re: character codes for terminals



From: Tomohiro KUBOTA <tkubota@riken.go.jp>
Date: Mon, 13 Nov 2000 21:54:46 +0900
> 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
> ----------------------------

I suspect why you enforce to use OUTPUT_CHARSET.
It should be remove.

Imagine following situation (in woody):

 1) start kterm 
 2) set kterm as EUC-JP mode (Press Ctrl+Mouse Middle Button, then
    japanese EUC mode on)
 3) export OUTPUT_CHARSET=SJIS
 4) ls --help (or something to write message catalogs)

Then, you can see broken strings. Because OUTPUT_CHARSET is set as
SJIS charset, but written message is EUC-JP charset.
This example can be happened not only EUC-JP but also ISO-8859-*.

> 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.

I don't know there are such a nice method.
BTW, Is it good idea to limit displaying charset?
I want to use many charset in a same time.

Regards,
-- GOTO Masanori



Reply to: