[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: distinguishing multibyte/unibyte ASCII
From: |
Alain Schneble |
Subject: |
Re: distinguishing multibyte/unibyte ASCII |
Date: |
Fri, 9 Sep 2016 23:02:23 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (windows-nt) |
Stefan Monnier <address@hidden> writes:
>> If you just generate an ASCII string from ASCII characters, it will
>> usually be unibyte. If you take it as a substring from a multibyte
>> buffer, it will usually be multibyte.
>
> And it's arguably a wart in Emacs's handling of chars-vs-bytes.
> But it's kind of hard to fix now.
>
> At some point I tried to change this handling (not exactly fix it) by
> treating multibyte ASCII strings specially (it's easy to recognize by
> checking that the char length is equal to the byte length and both are
> readily available in the "struct Lisp_String" object). Then when we
> read an ASCII string, instead of making it unibyte, I'd keep it as
> multibyte. And then change things like "concat" so that those "ASCII
> multibyte" strings don't force the result to be multibyte.
>
> My local Emacs still runs with those changes, but in the end I don't
> think the result is really better (or sufficiently better to justify
> the subtle incompatibilities it introduces).
I'm relieved to hear that :) Thanks for sharing it.
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., (continued)
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Eli Zaretskii, 2016/09/09
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Alain Schneble, 2016/09/09
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Eli Zaretskii, 2016/09/09
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Toke Høiland-Jørgensen, 2016/09/09
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Eli Zaretskii, 2016/09/10
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Dmitry Gutov, 2016/09/10
- Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Eli Zaretskii, 2016/09/10
- distinguishing multibyte/unibyte ASCII (was: [PATCH] url: Wrap cookie headers in url-http--encode-string.), Stefan Monnier, 2016/09/09
- Re: distinguishing multibyte/unibyte ASCII, Toke Høiland-Jørgensen, 2016/09/09
- Re: distinguishing multibyte/unibyte ASCII, Stefan Monnier, 2016/09/09
- Re: distinguishing multibyte/unibyte ASCII,
Alain Schneble <=
- Re: distinguishing multibyte/unibyte ASCII (was: [PATCH] url: Wrap cookie headers in url-http--encode-string.), Eli Zaretskii, 2016/09/10
Re: [PATCH] url: Wrap cookie headers in url-http--encode-string., Lars Ingebrigtsen, 2016/09/07