From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: libnettle/libhogweed WIP Date: Wed, 19 Apr 2017 16:16:39 +0200 Message-ID: References: <83a89gq3us.fsf@gnu.org> <87bmtjiv0w.fsf_-_@lifelogs.com> <83o9xjn06c.fsf@gnu.org> <87shmeb5ln.fsf_-_@lifelogs.com> <83y3w5z1ez.fsf@gnu.org> <87lgr6yakj.fsf@lifelogs.com> <87wpamww9k.fsf@lifelogs.com> <8337daggnj.fsf@gnu.org> <87d1cdwxt6.fsf@lifelogs.com> <83tw5pg1q3.fsf@gnu.org> <87zifhulc2.fsf@lifelogs.com> <83h91og80k.fsf@gnu.org> <87pogbuhoe.fsf@lifelogs.com> <834lxndmd9.fsf@gnu.org> <87efwrug6z.fsf@lifelogs.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1492611430 1059 195.159.176.226 (19 Apr 2017 14:17:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 19 Apr 2017 14:17:10 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 19 16:17:03 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d0qPm-0008V1-E8 for ged-emacs-devel@m.gmane.org; Wed, 19 Apr 2017 16:17:02 +0200 Original-Received: from localhost ([::1]:48402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0qPq-00041X-En for ged-emacs-devel@m.gmane.org; Wed, 19 Apr 2017 10:17:06 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53155) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d0qPi-00040g-42 for emacs-devel@gnu.org; Wed, 19 Apr 2017 10:16:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d0qPe-0006WK-V2 for emacs-devel@gnu.org; Wed, 19 Apr 2017 10:16:58 -0400 Original-Received: from hermes.netfonds.no ([80.91.224.195]:48755) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d0qPe-0006Ta-OO for emacs-devel@gnu.org; Wed, 19 Apr 2017 10:16:54 -0400 Original-Received: from cm-84.213.17.174.getinternet.no ([84.213.17.174] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1d0qPR-0008Di-AV; Wed, 19 Apr 2017 16:16:43 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAD1BMVEUbChA2OGCOotArIjlF S332700HAAACU0lEQVQ4jVWTC9LrIAiFaekCQmEBrXEBWrKAaNz/mu7BNP3nMtPH+MnrgCRjjNYb vrvlnn5GVXGYq7TR83v8EZJj5G2tNUC2kX8A9+2p1cWeuYuNHxh9tMHusllKNXJdALaTM4IBiDQ5 UYDuzowiUhIRr1Hn6NPDvZAvEwwFMbhNjzcAO3IcNo4AiwiNw3KpC5E+elpRCuz0kNGUibjeenoZ gEWQRPjJTgsA97QDNJNhs6q+sr+QozzTvkGTKDh3Qsk71ZXI6ZNe8MqtZ3RyAn8T1XJPOz8hWUr5 BIgzAJY7/t17Xj6zc3zeSACgHFd6av0Letq4OomGB/VDLpB7QQIyvWeAu9Z8gndBHJ4emR/HjbdT 9pR9O5y8iX7e/EnO/QuahriM4j4v2tbtmmCKCWhUk3wnbt4vgGmLleopryG++w+oo8GDHjKQCvY5 QZcRu6FEBPndjwKQMQ+MGANNmBQ3mh6bayiBBRW1ADeBV6FyKxQGRcaQCPXw0B6n+wToovfcD6jo xX3qOa2ZYS4HeOWCMbKPM1TD8qX3WMgVbTAO+QReY2Fwi9HPFqMHCYStxAIZlaIK6SlGM22LPTLB Td3JDqYruWD/TRozyULWPGJNw6GI+o1ZdgwrsvrXA1I1fTjbzrZcGdBWNXHZTR9SuErKOBuzXEFr vqwAeFae1sLEZygNQQ+tqKgus42zQTGPT5kr4fTYv2XVhh4Mz9COGpdrC+0jVIm3jGdoehb01TBk h8XLU57jeC5fIFGWVr3AZepRlipW0f3X3Sy3ynz3Q/4j/wBG5Y9u80OSPQAAAABJRU5ErkJggg== In-Reply-To: (Stefan Monnier's message of "Wed, 19 Apr 2017 08:22:10 -0400") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 80.91.224.195 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214117 Archived-At: Stefan Monnier 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=C3=A9llo")) =3D> "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. --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no