[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: libnettle/libhogweed WIP
From: |
Lars Ingebrigtsen |
Subject: |
Re: libnettle/libhogweed WIP |
Date: |
Wed, 19 Apr 2017 16:16:39 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
> Forcing your users to (de|en)code explicitly before calling your
> functions isn't making them jump through hoops: it's helping them have
> the correct mental model of what "multibyte text" means.
I agree. While "just encrypt this string already" is a tempting thing
to be able to say, encryption doesn't really work on characters, but on
octet streams, so it turns into a head-scratcher when you get a weird
result.
But Emacs does have functions already that are rather... vague... about
what they do in this area and people seem to live with the ambiguity:
(base64-decode-string (base64-encode-string "Héllo"))
=> "H\351llo"
Which is... correct? But only if you know that the Emacs represents
non-ASCII strings as (approx.) UTF-8.
The less confusion in this area the better, and especially for
encryption functions where you really want to get the correct text back
again, I think it would be better, long-term, to not allow non-unibyte
text inputs.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
- Re: libnettle/libhogweed WIP, (continued)
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/20
- Re: libnettle/libhogweed WIP, Ted Zlatanov, 2017/04/20
- Re: libnettle/libhogweed WIP, Lars Ingebrigtsen, 2017/04/20
- Re: libnettle/libhogweed WIP, Ted Zlatanov, 2017/04/20
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/21
- Re: libnettle/libhogweed WIP, Lars Ingebrigtsen, 2017/04/21
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/21
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/21
- Re: libnettle/libhogweed WIP, Ted Zlatanov, 2017/04/18
- Re: libnettle/libhogweed WIP, Stefan Monnier, 2017/04/19
- Re: libnettle/libhogweed WIP,
Lars Ingebrigtsen <=
- Re: libnettle/libhogweed WIP, Stefan Monnier, 2017/04/19
- Re: libnettle/libhogweed WIP, Ted Zlatanov, 2017/04/19
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/19
- Re: libnettle/libhogweed WIP, Stefan Monnier, 2017/04/19
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/19
- Re: libnettle/libhogweed WIP, Ted Zlatanov, 2017/04/19
- Re: libnettle/libhogweed WIP, Lars Ingebrigtsen, 2017/04/19
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/19
- Re: libnettle/libhogweed WIP, Stefan Monnier, 2017/04/19
- Re: libnettle/libhogweed WIP, Eli Zaretskii, 2017/04/19