From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#31149: 27.0.50; (gui-get-selection nil 'text/html) returns mis-decoded text Date: Tue, 09 Nov 2021 04:44:17 +0100 Message-ID: <87sfw6t2lq.fsf@gnus.org> References: <87ee7rcv57.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9522"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 31149@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 09 04:45:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1mkI4N-0002FP-NR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Nov 2021 04:45:11 +0100 Original-Received: from localhost ([::1]:54410 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkI4L-0003bA-BI for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 08 Nov 2021 22:45:09 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56388) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkI4E-0003az-Fz for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 22:45:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mkI4E-00061L-7e for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 22:45:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mkI4E-0001r6-5l for bug-gnu-emacs@gnu.org; Mon, 08 Nov 2021 22:45:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Nov 2021 03:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31149 X-GNU-PR-Package: emacs Original-Received: via spool by 31149-submit@debbugs.gnu.org id=B31149.16364294757073 (code B ref 31149); Tue, 09 Nov 2021 03:45:02 +0000 Original-Received: (at 31149) by debbugs.gnu.org; 9 Nov 2021 03:44:35 +0000 Original-Received: from localhost ([127.0.0.1]:60173 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkI3n-0001q1-F3 for submit@debbugs.gnu.org; Mon, 08 Nov 2021 22:44:35 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:54674) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkI3l-0001pj-9t for 31149@debbugs.gnu.org; Mon, 08 Nov 2021 22:44:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From: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=Dgt7987iXn2uft54x5UhvXtvLLeqoN1btlihqqd9afc=; b=fwW2oDFCA+OUcC+8Xw3rm42hhI MkpHBWuh0yYBvz/PqS4lLgYanCbyk5SdmELyv6iL/g00uid+NQNsPViQJwkNNFzxX+KrQT64zsO6r BBuFiaXjrMW8cYp8KhwBy5xcp0+cp7Kcq0ILnL+rp0G0zKooq0bQUNLI3rSr5W4zfqX0=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkI3X-0008Gl-Ev; Tue, 09 Nov 2021 04:44:26 +0100 X-Now-Playing: IDM Theft Able's _Rogue Pulse: Gravity Collapse (10)_: "Exhalations in a Flashlight Beam" In-Reply-To: <87ee7rcv57.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 08 Nov 2021 02:07:32 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219388 Archived-At: Lars Ingebrigtsen writes: > Stefan Monnier writes: > >> (gui-get-selection nil 'text/html) >> >> returns utf-16 text when the primary selection is owned by Mozilla, but >> we decode it as latin-1 instead, so it looks like garbage. > > This should now be fixed on the trunk, and hopefully I didn't regress > anything, but I have not regressed anything. (I've only tested on > Debian and Macos.) Let me know whether I broke something. It broke selection on Windows, so I've reverted and reopened this bug report. >From the discussion on emacs-devel: > > > Does reverting 5e66c75e0 fix the issue? > > > > I've reverted it now and will have to reexamine the problem before > > attempting a new fix. > > Whatever you do, don't decode the selection text on MS-Windows. It is > already decoded (see w32-get-clipboard-data), and > selection-coding-system is UTF-16 on MS-Windows, so decoding a decoded > string by that will not do anything useful ;-) > > The existing code carefully side-steps the decoding by looking at the > foreign-selection property on the string, which the Windows code > doesn't set. But your changes removed that test, and thus caused the > clipboard text to be decoded on Windows. So I'll be re-exploring this issue once I get my Windows VMs back up and can do some testing on Windows, too. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no