From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.devel Subject: Re: How to get buffer byte length (not number of characters)? Date: Thu, 22 Aug 2024 21:32:12 +0200 Message-ID: References: <87wmkbekjp.fsf@ushin.org> <86o75nwilg.fsf@gnu.org> <87bk1lhkvg.fsf@ushin.org> <86y14pu5rp.fsf@gnu.org> <871q2hfn7c.fsf@ushin.org> <86plq1td4n.fsf@gnu.org> <87ed6hdnpe.fsf@ushin.org> <865xrsu8c8.fsf@gnu.org> <87ttfcl8bn.fsf@ushin.org> <86zfp4qtxn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zSqiKqwVkstLB8Is" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12603"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Joseph Turner , emacs-devel@gnu.org, schwab@suse.de, adam@alphapapa.net To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 22 21:33:14 2024 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 1shDYY-0002yJ-Ps for ged-emacs-devel@m.gmane-mx.org; Thu, 22 Aug 2024 21:33:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shDXi-0001iI-BY; Thu, 22 Aug 2024 15:32:22 -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 1shDXe-0001gW-RT for emacs-devel@gnu.org; Thu, 22 Aug 2024 15:32:19 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shDXc-0000kq-Sg; Thu, 22 Aug 2024 15:32:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=XAqRVvMywwT27ZllwdXjRpWVBWjWhB3CxZopwU2mGUI=; b=OKmUitnZECLXZRptZFbunCBE9Y LDxHBvugOcj7TxfXOlC/9w1XCOwIqIQ4sHMCicm5D/HzQu8I6KI+7GJH4u07nqmcObUOugQJJ9W/S W6jc46j0+j1KfFxNCfqRV/FbiE2GCO8vTE05L2g5fwARRM5gisH5ihAopML2a4fUFuy4Gy34ZqGzT MwvTELU3y3EVHlbfKGj1y6qgbBghhddGz5flqyP8s1xTBsvhfn5GD18zRzNDkVxThe8xRTp2JE3Rf xC2xLFhCLfkKKn4VhEApkiljskq55oKsEgi0M0xTI4/S4lRmmYjY1+oUlmZiR4H+XnF1oWwG0/f6G 98scfFMg==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.94.2) (envelope-from ) id 1shDXY-0005sC-VR; Thu, 22 Aug 2024 21:32:13 +0200 Content-Disposition: inline In-Reply-To: <86zfp4qtxn.fsf@gnu.org> Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=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:323058 Archived-At: --zSqiKqwVkstLB8Is Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 22, 2024 at 09:44:04PM +0300, Eli Zaretskii wrote: > > From: Joseph Turner [...] > > When decoding, should plz fallback to detect-coding-region instead of u= tf-8? >=20 > If this is HTML, then I think it is okay to trust the headers about > the charset and default to UTF-8. The problem with > detect-coding-region is that some of it is based on guesswork [...] Yes, and it's incredibly crude guesswork at times. Talk to the server admin. With HTML and friends, you get one or two layers of fun, because they can declare the encoding /whithin/ the stream (HTML in two different ways, at least). If the "outer layer" decides to helpfully recode, then the inner declarations are lying (I actually had this with HTML mails: the MIME layer recoded Latin-1 to UTF-8, the tag in there was a lie. Needless to say, html2text made mojibake :-) Cheers --=20 t --zSqiKqwVkstLB8Is Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRp53liolZD6iXhAoIFyCz1etHaRgUCZseSNQAKCRAFyCz1etHa RjefAJ9maJGD/14RhUJn/jKS/jpwyJBWuQCfUH4QZtGpYdMwwXcgKIYdXDiWzcM= =PnRt -----END PGP SIGNATURE----- --zSqiKqwVkstLB8Is--