From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuchen Pei Newsgroups: gmane.emacs.devel Subject: Coding warning attributes to wrong char Date: Sat, 17 Jun 2023 14:22:18 +1000 Message-ID: <87bkhebtvp.fsf@ypei.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15236"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jun 17 06:24:54 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qANUa-0003Sn-HG for ged-emacs-devel@m.gmane-mx.org; Sat, 17 Jun 2023 06:24:54 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qANSM-0007GY-Jg; Sat, 17 Jun 2023 00:22:34 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qANSK-0007GN-1k for emacs-devel@gnu.org; Sat, 17 Jun 2023 00:22:32 -0400 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qANSF-0004gk-VK for emacs-devel@gnu.org; Sat, 17 Jun 2023 00:22:31 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 80A285C02A5 for ; Sat, 17 Jun 2023 00:22:23 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 17 Jun 2023 00:22:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ypei.org; h=cc :content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm3; t=1686975743; x=1687062143; bh=F0kckRuAZHQGCTukpVm5eg6Q2 XQl1TSeYeLTVCRX1gA=; b=E3Z9zpqHa31B/nZNXE7iVdrGeUpevXsIg0XePZpGN z5Qn7826HjnLoy7VA78to0LKfLpn8Z4QLpArY8qLqJ8qliQzeJ2b9dqfb11iGfpo +SEEhUXP4vDsoDI09jVxtCCVL1KfECWujYUAToe0cgWKNU2jB/b9H2rEXj530ZU/ 5JlPGQ2Z86ZNh4XcyxM0LSAPBe8hnVTNHWiczROGsoK+OPLwFZPYg54iNqwaOhq7 2w+F0niVGGWfqJUVIc79bXMp1Vu61eivBaPwFiLiJzfJ+CZjDl905jFQrJyJV9z9 sreZyIdeEY2W2gbo3Xj2q97pDZDKHLhryBxrJo7Pg076g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1686975743; x=1687062143; bh=F0kckRuAZHQGCTukpVm5eg6Q2XQl1TSeYeL TVCRX1gA=; b=DUdxqqMYlzhxvvJGd1A6KAnG8Mw74fdUp1IhrXx8nTSe+ibtDqq kCUGp1vqdczNfOVt2xts2YIasP+Ify579TQwmrDCUeQydvqWcvqLMDmQLGvhvH/e vL+re4gqv2YXEFRJOMfnVM4VV1gIZ59l1dEj26CMCKbCkvsLerAcJhDKav51lAtQ ngD1ptRx6Q2M9bWJqq48E1imjLTGRT8NVjYFOsqy9NjrDe/QRrVxCUCNY/aVKyKP RK/pBd1JcGwrRFY9xJ0PGDSHCOxYmAhmGys6Ttw7UpQL2k2txFi2CNRyZPyOQ1Sk q9arFGRXQz6lbOeCdFSoHydMGQrlELREQrw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedviedggeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkfgggtgesmhdtreertd erjeenucfhrhhomhepjghutghhvghnucfrvghiuceoihguseihphgvihdrohhrgheqnecu ggftrfgrthhtvghrnhepveffheevleefudelgfeffedtiedvteeggeejhfelfedvleelle dvuefgkeevkeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomhepihguseihphgvihdrohhrgh X-ME-Proxy: Feedback-ID: i51b146f9:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Sat, 17 Jun 2023 00:22:22 -0400 (EDT) Received-SPF: pass client-ip=66.111.4.26; envelope-from=id@ypei.org; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:306849 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Could reprod in 28.2 and 29.0.91: 1. Open the attached text file, or save the following in a file and open it (hopefully displayed correctly here in your email client...) --8<---------------cut here---------------start------------->8--- The issue is not with =E2=80=99, but the (nul, insert with C-q C-@). --8<---------------cut here---------------end--------------->8--- 2. M-x set-buffer-file-coding-system utf-8 3. A warning appears, attributing the issue to the =E2=80=99, the quote (in= the following I have replaced the chars with literal strings --8<---------------cut here---------------start------------->8--- These default coding systems were tried to encode the following problematic characters in the buffer =E2=80=98encoding.txt=E2=80=99: Coding System Pos Codepoint Char utf-8-unix 23 #x3FFFE2 \342 24 #x3FFF80 \200 25 #x3FFF99 \231 However, each of them encountered characters it couldn=E2=80=99t encode: utf-8-unix cannot encode these: \342 \200 \231 Click on a character (or switch to this window by =E2=80=98C-x o=E2=80=99 and select the characters by RET) to jump to the place it appears, where =E2=80=98C-u C-x =3D=E2=80=99 will give information about it. Select one of the safe coding systems listed below, or cancel the writing with C-g and edit the buffer to remove or modify the problematic characters, or specify any other coding system (and risk losing the problematic characters). raw-text no-conversion --8<---------------cut here---------------end--------------->8--- Despite the warning, the correct fix is to remove the nul character. This can be quite misleading, especially when one wants to fix encoding issues in big text files. --=-=-= Content-Type: text/plain Content-Disposition: attachment; filename=encoding.txt Content-Transfer-Encoding: quoted-printable The issue is not with =E2=80=99, but the =00 (nul). --=-=-= Content-Type: text/plain Best, Yuchen -- PGP Key: 47F9 D050 1E11 8879 9040 4941 2126 7E93 EF86 DFD0 --=-=-=--