"Stephen J. Turnbull" <stephen(a)xemacs.org> さんは書きました:
>>>>> "Mike" == Mike FABIAN
<mfabian(a)suse.de> writes:
Mike> I don't understand this. If the system is running in an
Mike> UTF-8 locale, XEmacs should assume that the external
Mike> applications handle UTF-8.
Oh, come on, Mike. You've been to Japan, you've dealt with Japanese
applications. You've probably read Ohta's "Ima Nihongo ga Abunai."
Yes, but I don't believe him. Unicode does not endanger the Japanese
language in my opinion.
Maybe in the rest of the world, but it's just not a safe
assumption in
this country. And I doubt it's a safe assumption in the US, either.
I wrote *if* the system is running in an UTF-8 locale. If an UTF-8
locale is set, it is set for a reason.
It's also definitely unsafe to assume that users understand the
implications of their locale settings. You know what happens to "grep
[a-z]" in many locales, and I imagine SuSE gets as many bug reports as
Debian does.
Yes. If one wants the traditional Unix behaviour of "grep [a-z]" one
should run the grep in POSIX locale.
that file, I suspect that it was simply the case that the X11R6
implementation from which Ben took his data had no UTF-8 locales at
the time, and ja_JP.eucJP is simply the closest match. But I don't
have time to confirm that right now.
But usually you don't have to choose any special locale. Just call
setlocale(LC_ALL,"") to use settings from the environment variables.
That should be a good default for almost everything.
Mike> the default should be the locale set in the environment
when
Mike> XEmacs starts.
This may be true on SuSE. But I doubt it. Dired should default to
running ls in the POSIX locale on all systems I know of, EFS should
default to running ftp in the POSIX locale, etc.
Here I agree. When one wants to parse the output of programs like
"ls", it is always a good idea to do set a POSIX locale in the
environment for these programs in order not to get unexpected results
just because there are some strings translated in the output.
I really think that the right design for XEmacs is to save the
locale,
then set it to POSIX, and run applications in locales of XEmacs's
choosing. If XEmacs is functioning merely as a command shell for the
user, you're right, it should choose the user's locale. But if XEmacs
is parsing the output, it needs more control.
I think we agree here. In case of Dired and EFS it makes sense to
call external processes with "LC_ALL=POSIX" to be able to parse the
output reliably. But this is no reason to change the environment
variables for *all* external processes. This can be easily done
where needed, i.e. in Dired and EFS, for example like this:
(let ((process-environment process-environment))
(setenv "LC_ALL" "C")
[...]
call external process where you want to parse the output here
[...]
)
Mike> Using only UTF-8 cleans up the mess a lot and makes it
Mike> possible to forget about the encoding most of the time.
Good for SuSE, and I encourage you to set up SuSE's XEmacs package
that way. We'll work with you to make that easier and more reliable,
Thank you!
but at this point it's not obvious to me that making that the
XEmacs
default is a good idea or will be acceptable to the Review Board.
I am *not* arguing to make UTF-8 the default for XEmacs here. I am
just arguing to use the settings from the environment, whether they
are UTF-8 or not. If ja_JP.eucJP is in the environment, one should of
course use it, and not switch to UTF-8. In that case the user
obviously wishes to use ja_JP.eucJP and this wish should be obeyed
wherever possible. "wherever possible" means of course that you still
may need to use POSIX in cases where you have to parse the output like
in the Dired case. But I think we agree there.
--
Mike FABIAN <mfabian(a)suse.de>
http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。