help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: `write-region' writes different bytes than passed to it?


From: Stefan Monnier
Subject: Re: `write-region' writes different bytes than passed to it?
Date: Mon, 11 Feb 2019 17:06:57 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> > Yes, in a better world, a better deity would be well advised to make
>> > raw bytes unnecessary and non-existent.
>> I think raw bytes are OK.  The problem here is the encoding of a unibyte
>> text (i.e. treating the unibyte text as holding chars rather than bytes).
> If you have raw bytes inside otherwise legible text, encoding that
> text will have to encode the bytes as well.

But the "otherwise legible text" is multibyte text, so the semantics of
encoding that text is perfectly clear (regardless if it contains raw bytes).

What is not clear is the semantics of something like:

   (encode-coding-string (encode-coding-string STR CODING1) CODING2)

> So as soon as you have the former, you need to deal with the latter.

In your example, encoding is not applied to unibyte text, only
to multibyte text.  The raw-bytes there don't cause any trouble (they
just do the job they were designed to do).


        Stefan




reply via email to

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