[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: setenv -> locale-coding-system cannot handle ASCII?!
From: |
Kenichi Handa |
Subject: |
Re: setenv -> locale-coding-system cannot handle ASCII?! |
Date: |
Wed, 26 Feb 2003 11:34:46 +0900 (JST) |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.2.92 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI) |
In article <address@hidden>, "Stefan Monnier" <monnier+gnu/address@hidden>
writes:
>> (if (multibyte-string-p variable)
>> (setq variable (encode-coding-string variable locale-coding-system)))
>>
>> multibyte-string-p is mandatory because encode-coding-string
>> will change the byte-sequence of `variable' even if it is
>> unibyte.
>> Ex. (encode-coding-string "\201\300" 'iso-latin-1) => "\300"
> I find this behavior annoying because it makes the emacs-mule
> encoding appear in a situation where it is not mentioned.
> I wish that
> (encode-coding-string "\201\300" 'iso-latin-1)
> and
> (encode-coding-string (string-to-multibyte "\201\300") 'iso-latin-1)
> returned the same value.
Why? As I wrote before, what does bytes of unibyte string
means depends on a context.
In the former case, as it is given to encode-coding-string,
it is a multibyte form by which emacs represents
character(s), not a sequence of characters representing raw
bytes.
In the latter case, as it is given to string-to-multibyte,
it should be regard as a sequence of characters representing
raw bytes, thus the result of (string-to-multibyte
"\201\300") is still a sequence of raw-bytes. Encoding
raw-bytes should yield the same raw-bytes.
And, this behaviour of encode-coding-string on a unibyte
string is a natural consequence of encode-coding-region in a
unibyte buffer.
---
Ken'ichi HANDA
address@hidden
- setenv -> locale-coding-system cannot handle ASCII?!, Sam Steingold, 2003/02/24
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Kenichi Handa, 2003/02/25
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Miles Bader, 2003/02/25
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Kenichi Handa, 2003/02/25
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Stefan Monnier, 2003/02/25
- Re: setenv -> locale-coding-system cannot handle ASCII?!,
Kenichi Handa <=
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Stefan Monnier, 2003/02/25
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Kenichi Handa, 2003/02/26
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Stefan Monnier, 2003/02/26
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Kenichi Handa, 2003/02/26
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Kenichi Handa, 2003/02/26
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Stefan Monnier, 2003/02/26
- Re: setenv -> locale-coding-system cannot handle ASCII?!, Stefan Monnier, 2003/02/26
- tar-mode, Kenichi Handa, 2003/02/26
- Re: tar-mode, Stefan Monnier, 2003/02/26
- Re: tar-mode, Kenichi Handa, 2003/02/26