From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.help Subject: Re: `write-region' writes different bytes than passed to it? Date: Sun, 23 Dec 2018 00:13:50 +0100 Message-ID: References: <83d0q8136v.fsf@gnu.org> <83a7lc0whm.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1545520354 6958 195.159.176.226 (22 Dec 2018 23:12:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 22 Dec 2018 23:12:34 +0000 (UTC) Cc: help-gnu-emacs To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Dec 23 00:12:29 2018 Return-path: Envelope-to: geh-help-gnu-emacs@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 1gaqRZ-0001hn-LD for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Dec 2018 00:12:29 +0100 Original-Received: from localhost ([::1]:43225 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaqTg-0008Jm-57 for geh-help-gnu-emacs@m.gmane.org; Sat, 22 Dec 2018 18:14:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaqT7-0008JB-3k for help-gnu-emacs@gnu.org; Sat, 22 Dec 2018 18:14:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gaqT6-0001XM-DA for help-gnu-emacs@gnu.org; Sat, 22 Dec 2018 18:14:05 -0500 Original-Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]:40813) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gaqT5-0001VT-8y; Sat, 22 Dec 2018 18:14:03 -0500 Original-Received: by mail-oi1-x234.google.com with SMTP id t204so7678231oie.7; Sat, 22 Dec 2018 15:14:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ovCPz/MZ2BXWRNNZlog+gkvZGOxSa3vbGrt3vFApD14=; b=U12pH590ae7ZKt90/Viwu6ciNnFrwLucqde3B+5YLV+ZdI45UoTtNz18o91zwBHhYd kYTF8rlxdd9hv1J/Bb27Xe8OBfR7sBObP9NE0mQPr0CJFGn3YQNQ0ALIFPWOcKkiA7Fk drD7A4pNXtPBAL7gyPkGlQpQNgY+XGwHCcLJNfMhxzoKLkeYvdAweIfJr/pPLf7xw+bX NJrWISye1Z1taQYmg5onanfB7wTCOYltF6n+0He+FH0cucIOYbIfEyu0Ham+OGxekLqK 2RyjELpMZRrvt+rFHmkZyb+DC7WNBSPQrPMjzVWFDf+g4o/QKTHWraOTGmzzdOaeprAs Cifg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ovCPz/MZ2BXWRNNZlog+gkvZGOxSa3vbGrt3vFApD14=; b=odGO+cxSaJvNOxqhKddkCeWC7GGznFAoBD6kN058rbfaFSsIsAe0ltSpteZj4bDzDu g1Y/pka7LQJEyHk2PJg/AT0xSQlzoFxLVZJC/0nud9SmKZwqHreZbr28HHiTg/oUBdzk 7vjIvuEm5v2YWQ4rDFQ++OORjxOH/oc/TmwBsORZ3eOLSrh8xt645idZMoy1dQW+D6XI eg33fWVctIshT1LczqwApRN5quetD4UapRsUmFm0BaHm1cV9jjJMJGVtaxN98nbKiQjZ fDXOpTRG13ZN4Ya64GG6s7wyDHybEAenF66/6atQ0jlJXgUiheZqQNtgrUczVBBVPoJ6 fxVQ== X-Gm-Message-State: AA+aEWahmwQC9+8o0F804hmPANUsxmJHo/6Qo2lRxtPZj/farS7s4jIC ewXXa0QtII8OCrVJymRbFABVBXuzAX0WuEn1BNK0BA== X-Google-Smtp-Source: AFSGD/Vt69gNMz3/+G5WriEk/Y+FjJqvIqDo/CymWM2AR+wLchoKAhteVt9VEL5oYFXxTnYf+Hki+otYHVllnYoMhLM= X-Received: by 2002:aca:4008:: with SMTP id n8mr4971115oia.161.1545520441445; Sat, 22 Dec 2018 15:14:01 -0800 (PST) In-Reply-To: <83a7lc0whm.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::234 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:119028 Archived-At: 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 cases?