From unknown Thu Aug 14 18:38:27 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#22436 <22436@debbugs.gnu.org> To: bug#22436 <22436@debbugs.gnu.org> Subject: Status: read-coding-system uses wrong default when called from write-file Reply-To: bug#22436 <22436@debbugs.gnu.org> Date: Fri, 15 Aug 2025 01:38:27 +0000 retitle 22436 read-coding-system uses wrong default when called from write-= file reassign 22436 emacs submitter 22436 Richard Copley severity 22436 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 22 14:31:47 2016 Received: (at submit) by debbugs.gnu.org; 22 Jan 2016 19:31:47 +0000 Received: from localhost ([127.0.0.1]:58096 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMhQw-00065J-S3 for submit@debbugs.gnu.org; Fri, 22 Jan 2016 14:31:47 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51920) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMhQv-000654-SY for submit@debbugs.gnu.org; Fri, 22 Jan 2016 14:31:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMhQp-0000q0-Jp for submit@debbugs.gnu.org; Fri, 22 Jan 2016 14:31:40 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45450) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMhQp-0000pw-GX for submit@debbugs.gnu.org; Fri, 22 Jan 2016 14:31:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMhQo-0000Af-Ix for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 14:31:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMhQn-0000pP-Hz for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 14:31:38 -0500 Received: from mail-yk0-x229.google.com ([2607:f8b0:4002:c07::229]:33977) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMhQn-0000pF-DT for bug-gnu-emacs@gnu.org; Fri, 22 Jan 2016 14:31:37 -0500 Received: by mail-yk0-x229.google.com with SMTP id a85so98174603ykb.1 for ; Fri, 22 Jan 2016 11:31:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=tSQdPY6eMoIC5Wt56kt3kZ4UpXMWPABPJmBJIqwpYmU=; b=FjqBLvUlqiORzJSyuDVxBIhmU1dKRbD70yQrf6vn+qkgfHSBPL4Dkl0/0G5CsIXyzT lUHfWLRdLhA3WP9HoxipDg3vJThB0bGyc0FnQi+Rfk8NjUhOD1z8XlN3L79ecagQlK9V gaPlr4qWBsKryr2VKoA6LqY2ixJxCG7sPhG3WPFpVeLHmMd7ksz7vHyA4jwoiVWr0+Ff TwRNed/fLnAxYevIsVrfvgosMrsBCgWW+uR9gut4he6PM0QuxdgNxof17scbVwDBLrxq 93iviSo8G3uVe+2dxgZZxaRpDiDyLTp8xLmrWI8riiUGyf2Ncd8OEd8U98EAZPbe1mf5 Z55A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=tSQdPY6eMoIC5Wt56kt3kZ4UpXMWPABPJmBJIqwpYmU=; b=MMsKVIDUEMQSrOXBmtTI18f6hTjrWKB1eM2KgSbBCTG/QT5GikrTSbxQSUeGReE3Nn no5z3TUsKY89oLYsOXKQVuR1VxMN35hfLFiU2G/3+y223jZbcM67BsNSlrIeEltmuRHw D1/rcAEShcmd/klb3ChkdbZNDt0Am3wDIb9NVQUi251XkTh/nwMYnZWMv+STgAsbDXKe tnekJ/6PKVU55zt6EjKkxAjaMeYLjg9wWLMoNHz+L+C7E/XeoglkeCdBPe4X5vpvrxIW G8tvGaXNjiiXbMbH9+3H0b1qs1EZxy/uIdI0g+rImP1Yb5wiv4kImHoFIRUcRtAh/YEc 9D9Q== X-Gm-Message-State: AG10YOR8iTbfTgNb5HgOjLWrGTZC0tS4xNtu+UCNOnMLE7feI5aD18O+kzduRt1iLXX7QTic7JB5BSb57d4cwA== X-Received: by 10.129.19.214 with SMTP id 205mr2449289ywt.136.1453491096840; Fri, 22 Jan 2016 11:31:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.207.214 with HTTP; Fri, 22 Jan 2016 11:31:07 -0800 (PST) From: Richard Copley Date: Fri, 22 Jan 2016 19:31:07 +0000 Message-ID: Subject: read-coding-system uses wrong default when called from write-file To: "bug-gnu-emacs@gnu.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) >From "emacs -Q", enter a =E2=80=98 in the scratch buffer (e.g., by typing "= C-x 8 ["). Save or write the buffer. The minibuffer prompts "Select coding system (default chinese-iso-8bit): ". In GNU Emacs 25.0.50.1 (x86_64-w64-mingw32) of 2016-01-22 built on MACHINE Repository revision: f7dc6d8b5bb318e02a4016d93f8b34de0716f4dc Windowing system distributor 'Microsoft Corp.', version 10.0.10586 Configured using: 'configure --prefix /c/emacs/emacs-20160122-175552 --without-imagemagick --disable-dependency-tracking --enable-locallisppath=3D%emacs_dir%/../site-lisp 'CFLAGS=3D-Og -g -ggdb'' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND DBUS NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS Important settings: value of $LANG: ENG locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Saving file c:/temp/xyzzy... Quit Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message dired format-spec rfc822 mml mml-sec epg epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils help-mode easymenu cl-loaddefs pcase cl-lib iso-transl time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote w32notify dbusbind w32 multi-tty make-network-process emacs) Memory information: ((conses 16 91651 6242) (symbols 56 19640 0) (miscs 48 37 107) (strings 32 16064 5326) (string-bytes 1 434641) (vectors 16 15778) (vector-slots 8 819512 106167) (floats 8 162 20) (intervals 56 349 42) (buffers 976 12)) From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 22 16:23:06 2016 Received: (at 22436) by debbugs.gnu.org; 22 Jan 2016 21:23:06 +0000 Received: from localhost ([127.0.0.1]:58135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMjAf-0000HX-SN for submit@debbugs.gnu.org; Fri, 22 Jan 2016 16:23:06 -0500 Received: from eggs.gnu.org ([208.118.235.92]:48517) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMjAe-0000Gj-HK for 22436@debbugs.gnu.org; Fri, 22 Jan 2016 16:23:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMjAV-0001kF-Br for 22436@debbugs.gnu.org; Fri, 22 Jan 2016 16:22:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMjAV-0001kB-8y; Fri, 22 Jan 2016 16:22:55 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1473 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMjAU-00018f-MP; Fri, 22 Jan 2016 16:22:55 -0500 Date: Fri, 22 Jan 2016 23:23:13 +0200 Message-Id: <83zivx5mwu.fsf@gnu.org> From: Eli Zaretskii To: Richard Copley In-reply-to: (message from Richard Copley on Fri, 22 Jan 2016 19:31:07 +0000) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Richard Copley > Date: Fri, 22 Jan 2016 19:31:07 +0000 > > >From "emacs -Q", enter a ‘ in the scratch buffer (e.g., by typing "C-x > 8 ["). Save or write the buffer. The minibuffer prompts "Select coding > system (default chinese-iso-8bit): ". Why do you think that's wrong? From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 22 18:24:17 2016 Received: (at 22436) by debbugs.gnu.org; 22 Jan 2016 23:24:17 +0000 Received: from localhost ([127.0.0.1]:58175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMl3x-0004rx-3l for submit@debbugs.gnu.org; Fri, 22 Jan 2016 18:24:17 -0500 Received: from mail-yk0-f175.google.com ([209.85.160.175]:36187) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMl3v-0004rk-Rs for 22436@debbugs.gnu.org; Fri, 22 Jan 2016 18:24:16 -0500 Received: by mail-yk0-f175.google.com with SMTP id v14so104481623ykd.3 for <22436@debbugs.gnu.org>; Fri, 22 Jan 2016 15:24:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=biGZP1u174lgO6DU89MJGXAWWiQAwEuTGvG1vC1UjVU=; b=tH6U3IkhwRfie4xUaWjHMDeZ+hXBq2zeYi5M+rabSIiV7F32lNF7lgrcvHpi/jmo1d GTMaDk2TuR7KYzg+sB2U6csUcYO76RCBlp2n4Q6Stp0lLk9HdCZdK4kN3YVKFKjiq6Ga +ud8znkUUdUhzAEfBBq31PcTUSkbeCZzOH0lXxQMNs8PR5uIvhe/XF3o0rOeWV4F/aCQ BvkQgG8X77Eiof2CD7O6Ld3kAP7RSwiGQo3djBMxPd+LpISLgMyFtHaXyk2cpMPKDfSf Ha4l991gmZZA24Iz8lhzMchiXct/qFU2iDG1KDaXqnx/9Gon9z5mcZJMPvjILnpurVkT VWYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=biGZP1u174lgO6DU89MJGXAWWiQAwEuTGvG1vC1UjVU=; b=bPR9+wh7xtEFXKXoP03NT5ChXta7ibKhs+kQ5UnhYVjXpYN46yAA5URBn52Ro0uVLQ T0fSbgEbcwzXR/x/kOPk72Adj9U6LLVb88bFrLBRRLk6Qw02chNLz/ddPO2ShsDVHXH7 nslX2CclRf3wh8lE1ptmlYcHbdle10dKtPkFNbcKNbCkWiIMOQk2TJWseH6Mb2f7f+q5 IzjXbifkzjjhQ0ns/jggLEHwQm09PIMPryf7+It3tNURLkfG7PUUx1gGLjaAHHqlrTXR AjY5rT3PHaRrH3fTdIXW/SsxF7IV4qucncjUnD/nPr/ODGEv60lKmkMNR/nnKW6yScI1 DvMw== X-Gm-Message-State: AG10YOR0aEiL+bSFrYKjMMEefMf6CMkrUGmDJHZWzUVrZrV7aYbwr+sxFIVdhROpY5IYaZgiKB7LSYA8SnW8HQ== X-Received: by 10.37.27.70 with SMTP id b67mr3086349ybb.156.1453505050400; Fri, 22 Jan 2016 15:24:10 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.207.214 with HTTP; Fri, 22 Jan 2016 15:23:40 -0800 (PST) In-Reply-To: <83zivx5mwu.fsf@gnu.org> References: <83zivx5mwu.fsf@gnu.org> From: Richard Copley Date: Fri, 22 Jan 2016 23:23:40 +0000 Message-ID: Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file To: Eli Zaretskii Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 22 January 2016 at 21:23, Eli Zaretskii wrote: >> From: Richard Copley >> Date: Fri, 22 Jan 2016 19:31:07 +0000 >> >> >From "emacs -Q", enter a =E2=80=98 in the scratch buffer (e.g., by typi= ng "C-x >> 8 ["). Save or write the buffer. The minibuffer prompts "Select coding >> system (default chinese-iso-8bit): ". > > Why do you think that's wrong? Of course it's wrong. What do you mean? From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 00:55:57 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 05:55:57 +0000 Received: from localhost ([127.0.0.1]:58242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMrAz-00074w-Mf for submit@debbugs.gnu.org; Sat, 23 Jan 2016 00:55:57 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59465) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMrAy-00074l-Iw for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 00:55:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMrAo-0007LQ-BK for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 00:55:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42418) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMrAo-0007LM-81; Sat, 23 Jan 2016 00:55:46 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1673 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMrAn-0008KM-Lx; Sat, 23 Jan 2016 00:55:46 -0500 Date: Sat, 23 Jan 2016 07:56:05 +0200 Message-Id: <83vb6k6dqi.fsf@gnu.org> From: Eli Zaretskii To: Richard Copley In-reply-to: (message from Richard Copley on Fri, 22 Jan 2016 23:23:40 +0000) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Richard Copley > Date: Fri, 22 Jan 2016 23:23:40 +0000 > Cc: 22436@debbugs.gnu.org > > On 22 January 2016 at 21:23, Eli Zaretskii wrote: > >> From: Richard Copley > >> Date: Fri, 22 Jan 2016 19:31:07 +0000 > >> > >> >From "emacs -Q", enter a ‘ in the scratch buffer (e.g., by typing "C-x > >> 8 ["). Save or write the buffer. The minibuffer prompts "Select coding > >> system (default chinese-iso-8bit): ". > > > > Why do you think that's wrong? > > Of course it's wrong. What do you mean? Wrong how? in what way? what did you expect to happen instead? Your locale's default encoding, cp1252, cannot encode this character, so Emacs asked you to provide an encoding that can, and offered chinese-iso-8bit as the default. An encoding can be considered "wrong" if it fails to encode a character. AFAICS, chinese-iso-8bit does succeed in encoding it, so the above definition of "wrong" doesn't fit. In addition, there should be a *Warning* buffer displayed where you have a long list of encodings Emacs knows about that can encode this character; chinese-iso-8bit is just one of them, but the text there tells you to select any one of them. Do you see that buffer displayed? Given all this information, please do tell why you think what Emacs did was wrong, and what did you think Emacs should have done instead. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 04:46:15 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 09:46:15 +0000 Received: from localhost ([127.0.0.1]:58337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMulr-0004E4-1j for submit@debbugs.gnu.org; Sat, 23 Jan 2016 04:46:15 -0500 Received: from mail-yk0-f182.google.com ([209.85.160.182]:36796) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMulq-0004Ds-8B for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 04:46:14 -0500 Received: by mail-yk0-f182.google.com with SMTP id v14so113421625ykd.3 for <22436@debbugs.gnu.org>; Sat, 23 Jan 2016 01:46:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=zdmB/pgPMd+QrfsKUdHqtkTOfjDqpo1N1PAoTJ+LkB8=; b=obvN/ymSGRvXgwLEH72Rvo24KTY0Mc5mVfp2JLapDHKyeMrjHXFGNAz/K8olGR1lM2 BWKR4WFIMhbL7lNuj/fO0PX90H8JB/H6cjZlspLgpCYyJ0JPMAnIeya8cUZKTsUiKPeA TN3uMYXW2QmCi0MaJjes9k79LVBiVQ9J6FMC0cQv+DMmfEVNhQ6GCQ0CWSoaKT3GCqlv RNdt4Eb+7rL7KJ9TLSJPv7s+Y1eeQ2nMUmmLy0KGSO+if75QHLzZ8n6Q3HfZXITb+N6S NzqSWQtpbXV/QlDaWzUPVgjjiMNTOpG0qlFvECzM8B4ZAirKG+XK4FJptj5mzq1q1Wfi h1Gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=zdmB/pgPMd+QrfsKUdHqtkTOfjDqpo1N1PAoTJ+LkB8=; b=icLN7D8+5Kc5r8DsRKE1+86ctHmJDT8cFrWvp5VHGzB8zNjUMrs5D4d6ASXBihj6sZ sb5AtgGXptix4E1rM91UFG/pZFGuDk4Gh7s9bWHtiGmeaTIVVx9RAy0sV40m6izt5Ma/ XC5nMySy1vVByBcNbt+7g0iWmgUIxNqodXn+jIa8u8CqAlf4+CEbozo1nEX+M8w3l4zf DVOqm71PFgbDny/u9cfdlBB/Gq1XbjHFOIPFCibRlxuCLDCaR3nvtduNDGA25GXxMFii klLP68zUdtSR9A0Jcx5PqSGD3wYkFPoNrP24/JXGGUyPeqrr8QkKgdAtqYgw6N0Km97m IB1A== X-Gm-Message-State: AG10YOTUFc0ybxdvQZrKJH0PpwNlA/f6REZ8/NB7RkuYr/XhoMTf3FUy9ZRwQQi05UfPzxU3XgenGbRlzGakGw== X-Received: by 10.13.218.198 with SMTP id c189mr4097608ywe.165.1453542368709; Sat, 23 Jan 2016 01:46:08 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.207.214 with HTTP; Sat, 23 Jan 2016 01:45:39 -0800 (PST) In-Reply-To: <83vb6k6dqi.fsf@gnu.org> References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> From: Richard Copley Date: Sat, 23 Jan 2016 09:45:39 +0000 Message-ID: Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file To: Eli Zaretskii Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On 23 January 2016 at 05:56, Eli Zaretskii wrote: >> From: Richard Copley >> Date: Fri, 22 Jan 2016 23:23:40 +0000 >> Cc: 22436@debbugs.gnu.org >> >> On 22 January 2016 at 21:23, Eli Zaretskii wrote: >> >> From: Richard Copley >> >> Date: Fri, 22 Jan 2016 19:31:07 +0000 >> >> >> >> >From "emacs -Q", enter a =E2=80=98 in the scratch buffer (e.g., by t= yping "C-x >> >> 8 ["). Save or write the buffer. The minibuffer prompts "Select codin= g >> >> system (default chinese-iso-8bit): ". >> > >> > Why do you think that's wrong? >> >> Of course it's wrong. What do you mean? > > Wrong how? in what way? what did you expect to happen instead? Wrong in the ordinary sense of the word, in that it is not right. It is however exactly what I expected. > Your locale's default encoding, cp1252, cannot encode this character, > so Emacs asked you to provide an encoding that can, and offered > chinese-iso-8bit as the default. Yes. > An encoding can be considered "wrong" if it fails to encode a > character. AFAICS, chinese-iso-8bit does succeed in encoding it, so > the above definition of "wrong" doesn't fit. It encodes the character to #xa1 #xae . When I open the file that is decoded as "=C2=A1=C2=AE", without asking any questions. Isn't that what yo= u saw? Are you going to tell me that's right too? > In addition, there should be a *Warning* buffer displayed where you > have a long list of encodings Emacs knows about that can encode this > character; chinese-iso-8bit is just one of them, but the text there > tells you to select any one of them. Do you see that buffer > displayed? Yes, but chinese-iso-8bit is not on the list. > Given all this information, please do tell why you think what Emacs > did was wrong, Do you seriously think it's the right thing to do? That's the last thing I expected. I don't know how to respond. > and what did you think Emacs should have done instead. I think Emacs should pick something less surprising and unhelpful, like utf-8. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 06:31:51 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 11:31:51 +0000 Received: from localhost ([127.0.0.1]:58353 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMwQ3-0006hk-HX for submit@debbugs.gnu.org; Sat, 23 Jan 2016 06:31:51 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42850) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMwQ1-0006hY-6B for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 06:31:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMwPs-0003vl-GH for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 06:31:43 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMwPs-0003vh-Ct; Sat, 23 Jan 2016 06:31:40 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2141 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMwPr-0005to-Pw; Sat, 23 Jan 2016 06:31:40 -0500 Date: Sat, 23 Jan 2016 13:31:59 +0200 Message-Id: <83h9i45y6o.fsf@gnu.org> From: Eli Zaretskii To: Richard Copley In-reply-to: (message from Richard Copley on Sat, 23 Jan 2016 09:45:39 +0000) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Richard Copley > Date: Sat, 23 Jan 2016 09:45:39 +0000 > Cc: 22436@debbugs.gnu.org > > > An encoding can be considered "wrong" if it fails to encode a > > character. AFAICS, chinese-iso-8bit does succeed in encoding it, so > > the above definition of "wrong" doesn't fit. > > It encodes the character to #xa1 #xae . When I open the file that is > decoded as "¡®", without asking any questions. Isn't that what you > saw? Are you going to tell me that's right too? Emacs never asks questions when decoding text, only when encoding it. When it visits a file, it guesses the encoding as best it can, and that's what you see. If you type "C-x RET c chinese-iso-8bit RET C-x C-f FILE RET", do you see that character correctly decoded and correctly displayed? > > In addition, there should be a *Warning* buffer displayed where you > > have a long list of encodings Emacs knows about that can encode this > > character; chinese-iso-8bit is just one of them, but the text there > > tells you to select any one of them. Do you see that buffer > > displayed? > > Yes, but chinese-iso-8bit is not on the list. It is: that's the first one in the list, gb2312. It's an alias for chinese-iso-8bit, which is the formal name. > > Given all this information, please do tell why you think what Emacs > > did was wrong, > > Do you seriously think it's the right thing to do? That's the last thing > I expected. I don't know how to respond. > > > and what did you think Emacs should have done instead. > > I think Emacs should pick something less surprising and unhelpful, > like utf-8. Unless it gets some hint from the locale or from customizations, Emacs does not prefer any encoding to any other encoding. GB2312 is a very reasonable choice in some locales, and might be what you want. How is Emacs to know, if your locale is US English? All it knows is that your default encoding cannot be used. What Emacs did here is produce a list of all the encodings that can encode that character, sorted them according what it knows about your preferences (which is nothing in this case), and then picked up the first encoding in the resulting list. And that's what you see. UTF-8 is also in the list, but it comes later. If you want Emacs to prefer UTF-8, you can have that. Just type M-x prefer-coding-system RET utf-8 RET That's it, Emacs will from now on use UTF-8 whenever it can without asking. If you repeat your recipe after setting that preference, it will silently encode the buffer/region with UTF-8, no questions asked. You can have this customization in your ~/.emacs file, of course, if you want it permanent. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 06:53:49 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 11:53:49 +0000 Received: from localhost ([127.0.0.1]:58357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMwlJ-0007C6-E5 for submit@debbugs.gnu.org; Sat, 23 Jan 2016 06:53:49 -0500 Received: from mail-yk0-f178.google.com ([209.85.160.178]:34805) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMwlI-0007Bt-0l for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 06:53:48 -0500 Received: by mail-yk0-f178.google.com with SMTP id a85so115031649ykb.1 for <22436@debbugs.gnu.org>; Sat, 23 Jan 2016 03:53:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=0m9qFSrc0djHHZJdH9c+aNV1zGN2oqyioTGiUbnD14g=; b=YI0ImVsznhpMeHWvvl7cLqRjgcvev3ivamtO6zNDJcSmFVD4kUq62im8bKUC0UUpxE XhamG7Td72pyEqiG3y8GsYH7Wqa0XfvweifVUU/zv0O2Kcnik5ON7qfRVGrzp5Q9FNwe l1TEWMYFpeszyxjYf0ExN+PpHjVIe64f/ByOgIYKDukuZoVO9UHKlBt+3UfMfUEx2ldx LVC2odDcnJt2I1K5iz4hsG6DySrKD/iC1l+5HePVUREKFQUEbibm3y5tT7PlptXndn4y zT0eHck9L2kFpDwSU0wCXST2UKp2UgjOZWEinK32x0MFyALbNan1z5QyZMnLx4oFRb+H Hn9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=0m9qFSrc0djHHZJdH9c+aNV1zGN2oqyioTGiUbnD14g=; b=K3uufAricktc9x6zpLIVb/NKXxZSZkgHVIXzNfU/swPQjWuGJTECRAbt2hfLcefjzR lydrWQ6epO3Z2piC4qXRNUF8Byy3NLIJlva5ptn+r9Y2ZvFVxkihuxRMTCRYI6pCSTFy wsugWUs8pLzPUY2y/GiwkNBx7dfDxllXbcZjbLo7RiuTfTxQF6RzKxMSSJorajAY3Vwb jGqZXmjvcNvWviEhgr1L9lKpW5w/kuLZDTNFMa8qAiip6gNdO+BSy1Nm/+Qg3aVEafmo IdUx6XbS7LLPWXSYs28KB+HzSV+qNB7HItP6EQDkfQIfP+t8VuVjxEkeDGqWfl0RIkXg TeFw== X-Gm-Message-State: AG10YOQCFVP4TfLITcNKHpTw0liZ0Yw1FfOmZEHxT9tTa6q/7YJ/P1KltrnQOYhmHAKk6Kwb/Q+6/qFAqWtdcQ== X-Received: by 10.37.230.210 with SMTP id d201mr4107809ybh.123.1453550022429; Sat, 23 Jan 2016 03:53:42 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.207.214 with HTTP; Sat, 23 Jan 2016 03:53:13 -0800 (PST) In-Reply-To: <83h9i45y6o.fsf@gnu.org> References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <83h9i45y6o.fsf@gnu.org> From: Richard Copley Date: Sat, 23 Jan 2016 11:53:13 +0000 Message-ID: Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file To: Eli Zaretskii Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Thanks for explaining that. I imagined Emacs would use a heuristic based on the contents of the file. If there were a fallback ordering that preferred utf-8 or some other universally applicable coding system it would be easier for most users and less confusing for beginners. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 08:09:36 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 13:09:36 +0000 Received: from localhost ([127.0.0.1]:58386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMxwe-0002Ax-JY for submit@debbugs.gnu.org; Sat, 23 Jan 2016 08:09:36 -0500 Received: from eggs.gnu.org ([208.118.235.92]:37180) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMxwd-0002Aj-0I for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:09:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMxwP-0002NH-J3 for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:09:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMxwP-0002ND-FE; Sat, 23 Jan 2016 08:09:21 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2203 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMxwN-0001B1-MU; Sat, 23 Jan 2016 08:09:20 -0500 Date: Sat, 23 Jan 2016 15:09:39 +0200 Message-Id: <83a8nw5tnw.fsf@gnu.org> From: Eli Zaretskii To: Richard Copley In-reply-to: (message from Richard Copley on Sat, 23 Jan 2016 11:53:13 +0000) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <83h9i45y6o.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Richard Copley > Date: Sat, 23 Jan 2016 11:53:13 +0000 > Cc: 22436@debbugs.gnu.org > > Thanks for explaining that. I imagined Emacs would use a > heuristic based on the contents of the file. There is indeed a heuristic, but it's not very smart, and only works well when the encoding is blatantly clear. This is an area where improvements are welcome. In any case, when presented with a buffer that includes a single non-ASCII character that can be encoded by a dozen of possible encodings, it's hard to be too smart based on the contents alone. > If there were a fallback ordering that preferred utf-8 or some > other universally applicable coding system it would be easier > for most users and less confusing for beginners. Such a fallback does exist, see coding-system-priority-list. What "M-x prefer-coding-system RET" does is manipulate the priorities so that the encoding you typed is preferred. Do we close this report, or is there something else to do about it? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 08:12:48 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 13:12:48 +0000 Received: from localhost ([127.0.0.1]:58391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMxzk-0002FV-1h for submit@debbugs.gnu.org; Sat, 23 Jan 2016 08:12:48 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:47636) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMxzh-0002FM-Pi for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:12:46 -0500 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aMxzI-000821-Js; Sat, 23 Jan 2016 14:12:20 +0100 From: Lars Magne Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEXRWf8G7esB9vn/APAA /Pv+G/+nfPr/AOsV4dYi0btjncP/Bf7zNP8B8/kA+fs2vLLQiq3cAAABjElEQVQ4jb2RLZPCMBBA V1VhYE6cJYOlpgKBu4mOQ4E4VYGtQOP4CT11DlHLoGowdVHnE9GJbXwVt7vloxztzM2JezTbZN9u UlrY9ABdyWSTJDCLZkmEi2g2iyK8GuY5RAf8Ifkhn+fEIecJ5D38g1hcxfKeOy4XCBwXXaw0tBYc VgVGrVkUlFxpfdItoCh0wb0a4EHcZgMNg9OTCGAAARDX/C8IguAx8X4VcRzz/bKOe/iDyLJsnd3Y r/dNZNFJv9j10BLbRzHsAUwnXwLFFO+mGTSdcr7kjsr6sDLGVqbytMagwBvvlVMeoaiUwRLvHGBC ca4iJ22zg5NAtdY7KZVzGD2DE8D9raf9uJOPsFihgI6r8FzcSilqNpaPA0uisoJW1Ga8tSzo4Suu IuU8ziWfwX9tGpaWH4I24jwJgZcVIhTcEU5UyB3CiLEQpZQluonzksqpA1/k+P5OR0MhMEsdre+x 3aKiMXqRb/DBpGlKY5dePtn29SKegfP5XOO9rutn8YP6E0s/O0TDN6Psk6p/9pJNAAAAAElFTkSu QmCC Date: Sat, 23 Jan 2016 14:12:20 +0100 In-Reply-To: <83vb6k6dqi.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jan 2016 07:56:05 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aMxzI-000821-Js X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1454159542.7361@Zz5P+Hze5Dyw4CWFRPevaQ X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 22436 Cc: Richard Copley , 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > Your locale's default encoding, cp1252, cannot encode this character, > so Emacs asked you to provide an encoding that can, and offered > chinese-iso-8bit as the default. While correct, it is a slightly less than helpful default. Most people deal (at most) with two charsets: One local, and if not, then Unicode. (Which would be utf8 on most systems, and possibly ucs16 on Windows, I dunno.) So `chinese-iso-8bit' is a surprising default. Could the default be improved upon? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 08:46:00 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 13:46:00 +0000 Received: from localhost ([127.0.0.1]:58402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMyVo-00032C-Rh for submit@debbugs.gnu.org; Sat, 23 Jan 2016 08:46:00 -0500 Received: from eggs.gnu.org ([208.118.235.92]:44932) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMyVk-00031x-PF for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:45:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMyVb-0003UX-GZ for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:45:47 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMyVb-0003UT-Cq; Sat, 23 Jan 2016 08:45:43 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2220 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMyVa-00010R-Jf; Sat, 23 Jan 2016 08:45:43 -0500 Date: Sat, 23 Jan 2016 15:46:02 +0200 Message-Id: <8337to5rz9.fsf@gnu.org> From: Eli Zaretskii To: Lars Magne Ingebrigtsen In-reply-to: (message from Lars Magne Ingebrigtsen on Sat, 23 Jan 2016 14:12:20 +0100) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436 Cc: rcopley@gmail.com, 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Lars Magne Ingebrigtsen > Cc: Richard Copley , 22436@debbugs.gnu.org > Date: Sat, 23 Jan 2016 14:12:20 +0100 > > Eli Zaretskii writes: > > > Your locale's default encoding, cp1252, cannot encode this character, > > so Emacs asked you to provide an encoding that can, and offered > > chinese-iso-8bit as the default. > > While correct, it is a slightly less than helpful default. It's not a default, it's just the first member of a list sorted according to some comparison function. > Most people deal (at most) with two charsets: One local, and if not, > then Unicode. That's only correct if the encoded text is going to be used on the same platform. This email message is an excellent example where this logic is simply false, because you and I live in different locales, and "Unicode" means different things to us. (Anyway, when you say "most people", did you consider how many people in the world consider chinese-iso-8bit a very good first choice? ;-) > Which would be utf8 on most systems, and possibly ucs16 on Windows, > I dunno. Using UTF-16 on Windows would be disastrous: almost no program, certainly not those which are ports of GNU software, can do anything useful with such an encoding. Emacs is the only exception I know of. > So `chinese-iso-8bit' is a surprising default. It's not a default. > Could the default be improved upon? We can sort the list differently. But if all we want is to always get UTF-8 at the head, there's a much easier way, see my other message where I mentioned prefer-coding-system. From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 08:56:15 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 13:56:15 +0000 Received: from localhost ([127.0.0.1]:58408 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMyfn-0003Gw-5h for submit@debbugs.gnu.org; Sat, 23 Jan 2016 08:56:15 -0500 Received: from hermes.netfonds.no ([80.91.224.195]:52876) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMyfl-0003Gn-IQ for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 08:56:14 -0500 Received: from cm-84.215.1.64.getinternet.no ([84.215.1.64] helo=stories) by hermes.netfonds.no with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1aMyfP-000077-2S; Sat, 23 Jan 2016 14:55:51 +0100 From: Lars Magne Ingebrigtsen To: Eli Zaretskii Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <8337to5rz9.fsf@gnu.org> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAMFBMVEXRWf8G7esB9vn/APAA /Pv+G/+nfPr/AOsV4dYi0btjncP/Bf7zNP8B8/kA+fs2vLLQiq3cAAABjElEQVQ4jb2RLZPCMBBA V1VhYE6cJYOlpgKBu4mOQ4E4VYGtQOP4CT11DlHLoGowdVHnE9GJbXwVt7vloxztzM2JezTbZN9u UlrY9ABdyWSTJDCLZkmEi2g2iyK8GuY5RAf8Ifkhn+fEIecJ5D38g1hcxfKeOy4XCBwXXaw0tBYc VgVGrVkUlFxpfdItoCh0wb0a4EHcZgMNg9OTCGAAARDX/C8IguAx8X4VcRzz/bKOe/iDyLJsnd3Y r/dNZNFJv9j10BLbRzHsAUwnXwLFFO+mGTSdcr7kjsr6sDLGVqbytMagwBvvlVMeoaiUwRLvHGBC ca4iJ22zg5NAtdY7KZVzGD2DE8D9raf9uJOPsFihgI6r8FzcSilqNpaPA0uisoJW1Ga8tSzo4Suu IuU8ziWfwX9tGpaWH4I24jwJgZcVIhTcEU5UyB3CiLEQpZQluonzksqpA1/k+P5OR0MhMEsdre+x 3aKiMXqRb/DBpGlKY5dePtn29SKegfP5XOO9rutn8YP6E0s/O0TDN6Psk6p/9pJNAAAAAElFTkSu QmCC Date: Sat, 23 Jan 2016 14:55:50 +0100 In-Reply-To: <8337to5rz9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Jan 2016 15:46:02 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-MailScanner-ID: 1aMyfP-000077-2S X-Netfonds-MailScanner: Found to be clean X-Netfonds-MailScanner-From: larsi@gnus.org MailScanner-NULL-Check: 1454162151.55172@7yBa9sQSMSWG0BkrwPW7Mg X-Spam-Status: No X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 22436 Cc: rcopley@gmail.com, 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: > (Anyway, when you say "most people", did you consider how many people > in the world consider chinese-iso-8bit a very good first choice? ;-) :-) >> Which would be utf8 on most systems, and possibly ucs16 on Windows, >> I dunno. > > Using UTF-16 on Windows would be disastrous: almost no program, > certainly not those which are ports of GNU software, can do anything > useful with such an encoding. Emacs is the only exception I know of. Right. I thought I had read somewhere that Windows was UTF-16-ey, but I know nothing about Windows... >> So `chinese-iso-8bit' is a surprising default. > > It's not a default. > >> Could the default be improved upon? > > We can sort the list differently. But if all we want is to always get > UTF-8 at the head, there's a much easier way, see my other message > where I mentioned prefer-coding-system. I guess I'm just saying that I think the least surprising default coding system here would be utf-8. So Emacs should offer that as the first option unless the user has said otherwise. That is, Emacs should say utf-8 unless the user has called `prefer-coding-system' with something else. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 23 09:39:13 2016 Received: (at 22436) by debbugs.gnu.org; 23 Jan 2016 14:39:13 +0000 Received: from localhost ([127.0.0.1]:58436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMzLK-0004I3-91 for submit@debbugs.gnu.org; Sat, 23 Jan 2016 09:39:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56442) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aMzLF-0004HW-DR for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 09:39:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aMzL5-0000NW-CF for 22436@debbugs.gnu.org; Sat, 23 Jan 2016 09:39:00 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aMzL5-0000NR-8e; Sat, 23 Jan 2016 09:38:55 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2248 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aMzL4-000176-GD; Sat, 23 Jan 2016 09:38:54 -0500 Date: Sat, 23 Jan 2016 16:39:14 +0200 Message-Id: <83zivw4ay5.fsf@gnu.org> From: Eli Zaretskii To: Lars Magne Ingebrigtsen In-reply-to: (message from Lars Magne Ingebrigtsen on Sat, 23 Jan 2016 14:55:50 +0100) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <8337to5rz9.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436 Cc: rcopley@gmail.com, 22436@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Lars Magne Ingebrigtsen > Cc: rcopley@gmail.com, 22436@debbugs.gnu.org > Date: Sat, 23 Jan 2016 14:55:50 +0100 > > >> Could the default be improved upon? > > > > We can sort the list differently. But if all we want is to always get > > UTF-8 at the head, there's a much easier way, see my other message > > where I mentioned prefer-coding-system. > > I guess I'm just saying that I think the least surprising default coding > system here would be utf-8. For you, maybe. What about all those Chinese out there? What if I'm writing an email to someone in China? Etc., etc. > That is, Emacs should say utf-8 unless the user has called > `prefer-coding-system' with something else. Most people who care about that already have their locales use UTF-8. So the problem largely doesn't exist. It's not an accident that this was reported by a Windows user. Anyway, this stuff worked for years, why should we suddenly change? From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 25 17:38:52 2016 Received: (at 22436) by debbugs.gnu.org; 25 Jan 2016 22:38:52 +0000 Received: from localhost ([127.0.0.1]:36451 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aNpme-0005a0-05 for submit@debbugs.gnu.org; Mon, 25 Jan 2016 17:38:52 -0500 Received: from mail-yk0-f169.google.com ([209.85.160.169]:33296) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aNpmc-0005Zn-8H for 22436@debbugs.gnu.org; Mon, 25 Jan 2016 17:38:50 -0500 Received: by mail-yk0-f169.google.com with SMTP id k129so180356120yke.0 for <22436@debbugs.gnu.org>; Mon, 25 Jan 2016 14:38:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=g7xX9Bo+rXCgFmF8ex2Nf7r7HDts4aRurZ3Hulx3tv8=; b=SICNMVvGQoqxSl3O8ADq2Gdp7nOQDM/hrVf1WwzfYs7fg0IV4GKmiByeuwItx3ORWD DfJmnH7NFvAIZvLp/KzPAOc5TuUxLbUSzhcziwQoV2dAaUiEcfi14IspbpIy4JoCOZ0j xV5LyHIWdowga7yknHmGH9RE33faw4DAQTdBjctxKqrA6FT8EU4atnsvpFyQPGT0B3aY Imc/IcCnMAMGuF7pDaZ1naKdSiATT9sPs7E2+vZvdrgftR64n3ZZK8GVVsAinIBLVMDh OH1tEw3Ln5jJ4yk8e/g+pQiFWL/99DS+tnRZvjOpV34sgTe6fPTVANIhJSnNL/054/JX CyxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=g7xX9Bo+rXCgFmF8ex2Nf7r7HDts4aRurZ3Hulx3tv8=; b=fHPBUEgxJgMaRC/5yXc1BOpAbadDE/j4FpiOQorVWqUjcINF+GwX9Ox019ltNP+UHQ 0u7FMOBg4elS8oKsYyc0TjXI17T5T7fesjsYznd3hURskblkmg2L9SD3UCiqvq5TICSk hT+ZFlAdw1ZUrpL0G5Y3LWu1FuM5s+Wch2zCjhem7VjOf57te5yxCUyFZwEzltLvqkA0 ZRZ5wuPxIh8nSAGgZtG99rFhsNMcEYVCLRFFqy1Sxx/T1FgE/HGFLDbCnHgAVUo0k0aS QeQNWUMA7GY911YE/ZJO41AbFWZ7fggi6w1O6KtkKHCmAgiN5ijWwto7c0l1BGbdm572 WzRA== X-Gm-Message-State: AG10YOQkKyvrqujsXvWmdX147VX+5JXbruKdvwyoTG6RX11hIXBownLq2rdVnODMua9YJU/v1nkbRa9YZIHW+g== X-Received: by 10.129.152.144 with SMTP id p138mr7730263ywg.85.1453761524681; Mon, 25 Jan 2016 14:38:44 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.207.214 with HTTP; Mon, 25 Jan 2016 14:38:15 -0800 (PST) In-Reply-To: <83zivw4ay5.fsf@gnu.org> References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <8337to5rz9.fsf@gnu.org> <83zivw4ay5.fsf@gnu.org> From: Richard Copley Date: Mon, 25 Jan 2016 22:38:15 +0000 Message-ID: Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file To: Eli Zaretskii Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 22436 Cc: 22436@debbugs.gnu.org, Lars Magne Ingebrigtsen X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) >> > We can sort the list differently. But if all we want is to always get >> > UTF-8 at the head, there's a much easier way, see my other message >> > where I mentioned prefer-coding-system. >> >> I guess I'm just saying that I think the least surprising default coding >> system here would be utf-8. > > For you, maybe. What about all those Chinese out there? What if I'm > writing an email to someone in China? Etc., etc. What about them, and everybody else? UTF-8 is good enough for all of us. Eli, you asked earlier if this report should be closed. I guess so! As you've explained, it's not a bug. I don't like the default behaviour, but it's pretty far down the list of things that I don't like about "emacs -Q". From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 26 10:39:12 2016 Received: (at 22436-done) by debbugs.gnu.org; 26 Jan 2016 15:39:12 +0000 Received: from localhost ([127.0.0.1]:37800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aO5i0-0001G3-T5 for submit@debbugs.gnu.org; Tue, 26 Jan 2016 10:39:12 -0500 Received: from eggs.gnu.org ([208.118.235.92]:53371) by debbugs.gnu.org with esmtp (Exim 4.84) (envelope-from ) id 1aO5hw-0001FY-Ay for 22436-done@debbugs.gnu.org; Tue, 26 Jan 2016 10:39:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aO5hm-0004YQ-F8 for 22436-done@debbugs.gnu.org; Tue, 26 Jan 2016 10:38:59 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aO5hm-0004YM-Bf; Tue, 26 Jan 2016 10:38:54 -0500 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1346 helo=HOME-C4E4A596F7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aO5hl-0008VX-9m; Tue, 26 Jan 2016 10:38:53 -0500 Date: Tue, 26 Jan 2016 17:39:22 +0200 Message-Id: <83io2g1hat.fsf@gnu.org> From: Eli Zaretskii To: Richard Copley In-reply-to: (message from Richard Copley on Mon, 25 Jan 2016 22:38:15 +0000) Subject: Re: bug#22436: read-coding-system uses wrong default when called from write-file References: <83zivx5mwu.fsf@gnu.org> <83vb6k6dqi.fsf@gnu.org> <8337to5rz9.fsf@gnu.org> <83zivw4ay5.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 22436-done Cc: 22436-done@debbugs.gnu.org, larsi@gnus.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Richard Copley > Date: Mon, 25 Jan 2016 22:38:15 +0000 > Cc: Lars Magne Ingebrigtsen , 22436@debbugs.gnu.org > > >> > We can sort the list differently. But if all we want is to always get > >> > UTF-8 at the head, there's a much easier way, see my other message > >> > where I mentioned prefer-coding-system. > >> > >> I guess I'm just saying that I think the least surprising default coding > >> system here would be utf-8. > > > > For you, maybe. What about all those Chinese out there? What if I'm > > writing an email to someone in China? Etc., etc. > > What about them, and everybody else? UTF-8 is good enough > for all of us. Not in the Far East, I'm afraid. > Eli, you asked earlier if this report should be closed. I guess so! > As you've explained, it's not a bug. I don't like the default > behaviour, but it's pretty far down the list of things that I don't > like about "emacs -Q". OK, closing. Thanks for pointing that out. From unknown Thu Aug 14 18:38:27 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 24 Feb 2016 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator