emacs-devel
[Top][All Lists]
Advanced

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

Re: emacs-26 8f18d12: Improve documentation of decoding into a unibyte b


From: Eli Zaretskii
Subject: Re: emacs-26 8f18d12: Improve documentation of decoding into a unibyte buffer
Date: Tue, 28 May 2019 21:58:03 +0300

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Tue, 28 May 2019 13:43:47 -0400
> 
> >   (let* ((str1 (string-as-multibyte (string char)))
> >      (str2 (string-as-multibyte (string char char)))
> 
> Why on earth do we call string-as-multibyte here?  AFAIK, the only cases
> where `string` returns a unibyte string is when char <128 (it could make
> sense to also do that for char ≥128 and <160, but we don't seem to do
> that currently) and these are better turned into multibyte via
> string-TO-unibyte (tho here we don't even need that, since the unibyte
> string works just as well for what we do) than string-AS-unibyte.
> 
> I think this is an error.  The patch below seems in order.

I'm not sure.  Be sure to read the comments about the tricky business
of this function, and the method it employs to solve it, and be sure
you understand all of the subtleties there.

> > I didn't think enough about this to figure out if there can be less
> > trivial use cases.  If you can describe all the cases where
> > find-coding-systems-string will return a list whose 'car' is
> > 'undecided', my hat off to you.
> 
> AFAIK it only happens for pure-ASCII strings.

What is your reasoning?



reply via email to

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