GNU bug report logs - #31149
27.0.50; (gui-get-selection nil 'text/html) returns mis-decoded text

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Date: Fri, 13 Apr 2018 20:56:02 UTC

Severity: normal

Found in version 27.0.50

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #57 received at 31149 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Cc: 31149 <at> debbugs.gnu.org
Subject: Re: bug#31149: 27.0.50; (gui-get-selection nil 'text/html) returns
 mis-decoded text
Date: Tue, 09 Nov 2021 04:44:17 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Stefan Monnier <monnier <at> IRO.UMontreal.CA> 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




This bug report was last modified 3 years and 194 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.