[Top][All Lists]

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

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

From: Philipp Stephani
Subject: Re: `write-region' writes different bytes than passed to it?
Date: Sun, 23 Dec 2018 00:13:50 +0100

Am Di., 11. Dez. 2018 um 19:41 Uhr schrieb Eli Zaretskii <>:
> > From: Stefan Monnier <>
> > Date: Tue, 11 Dec 2018 11:36:13 -0500
> >
> > > Yes, because "\xC1\xB2" just happens to be the internal multibyte
> > > representation of a raw-byte F2.  Raw bytes are always converted to
> > > their single-byte values on output, regardless of the encoding you
> > > request.
> >
> > Maybe we shouldn't encode unibyte strings (under the assumption
> > that a unibyte string is already encoded: it's a sequence of bytes
> > rather than a sequence of chars).
> I'm not sure that single use case is important enough to change
> something that was working like that since Emacs 23.  Who knows how
> many more important use cases this will break?

It's important for correctness and for actually describing what "encoding" does.

> This whole area is crawling with heuristics, whose only justification
> is that it does TRT in the vast majority of use cases.

Why should this be the right thing, what use case should it cover? Do
we expect users to explicitly put the byte sequences for the
(undocumented) internal encoding into unibyte strings? Shouldn't we
rather expect that users want to write unibyte strings as is, in all

reply via email to

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