Hi Jim & Frédéric,

I'm sorry for the very long delay in replying, I hope that my reply is
not obsolete before I even write it :-(

On Fri, Aug 10, 2007 at 11:49:31AM +1000, Jim Breen wrote:
> A problem I had/have with that patch from Phillip Vandry is that my working
> code version had already moved on to the extent I couldn't get around to
> working in his patch details line-by-line. My own version has a few
> extensions which I find useful.

I will be happy to refactor my patch into the new version. In fact it
will probably be a little bit letter since xjdic was the first bit of
code I wrote with serious locale & character encoding, and I have
learned since then.

The only problem is that I have an email from you from September 2003
promising a version 2.5 soon but maybe this fell through the cracks?

> > I'm attaching a version that's slightly modified to apply to 24-6.  I'm
> > also attaching a cheap hack I wrote to disable locale support when
> > TERM=kterm, in an attempt to have xjdic behave correctly when started in
> > a kterm when LANG is still set to a legacy encoding like latin-1.  (As I
> > used to do until recently.)

Please don't do that. The TERM/terminfo/termcap mechanism does not inform
applications of the character encoding in use and is not designed to do
this. This is the job of the locale mechanism (in order, the environment
variables LC_ALL, LC_CTYPE, LANG). When you are using kterm, your TERM
variable should be equal to kterm to tell applications about terminal
functionality and special keys, and your locale should specify an EUC-JP
locale. When you are using uxterm, your TERM should be set to xterm and
your locale should specify a UTF-8 locale.

(In fact I think this state of affairs is a mistake in retrospect, but
it's what we're stuck with. The reason it's a mistake is that the
current character encoding is not a user preference but dictated by the
terminal, like TERM is. Like TERM, it should be carried across ssh and
telnet sessions. As for locales on the other hand, users should be
completely free to set them without any system-imposed constraints, to
express their whismsical preferences like vouloir lire les messages en
français か日本語で読むこと.)

-Phil


Reply via email to