emacs-devel
[Top][All Lists]
Advanced

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

unibyte<->multibyte conversion [Re: Emacs-diffs Digest, Vol 2, Issue 28]


From: Kenichi Handa
Subject: unibyte<->multibyte conversion [Re: Emacs-diffs Digest, Vol 2, Issue 28]
Date: Mon, 20 Jan 2003 11:29:51 +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>, "Eli Zaretskii" <address@hidden> writes:
>>  If you want multibyte strings "without decoding", would emacs-mule
>>  give you that?

> I don't think so.  emacs-mule is for reading text that is already in
> the internal Emacs representation, like auto-save files.

Yes.

> AFAIK, raw-text does decode the text in the sense that
> 8-bit characters which have their 8th bit set are decoded
> into the eight-bit-* charsets.

Yes, but that is only in the case that you read a file into
a multibyte buffer by raw-text.  This conversion from raw
byte sequence to multibyte form is what done by
string-to-multibyte which I wrote in the previous mail.

On process reading, if raw-text is used, the process output
is at first read as a unibyte string, the string is coverted
to multibyte by string-as-mulitbyte (not by not-yet-existing
string-to-multibyte), then inserted in a multibyte buffer.

I don't remember why the current code does as above.  I
think the behaviour what Eli wrote is more consistent with
the behaviour of file reading.

Shall I change the code as what Eli wrote (by introducing
the new function string-to-multibyte)?

By the way, it may be clean to have all these functions in
parallel, and spare one section describing the difference of
MAKE, AS, TO conversions in info.

string-make-multibyte
string-as-multibyte
string-to-multibyte

string-make-unibyte
string-as-unibyte
string-to-unibyte (perpaps the same as string-as-unibyte, or
                  it should signal an error if non-ascii,
                  non-eight-bit-XXX is contained).

buffer-make-multibyte
buffer-as-multibyte (same as (set-buffer-multibyte BUFFER t))
buffer-to-multibyte

buffer-make-unibyte
buffer-as-unibyte (same as (set-buffer-multibyte BUFFER nil))
buffer-to-nuibyte


---
Ken'ichi HANDA
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]