From: Lars Ingebrigtsen <larsi@gnus.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: 31149@debbugs.gnu.org
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 [thread overview]
Message-ID: <87sfw6t2lq.fsf@gnus.org> (raw)
In-Reply-To: <87ee7rcv57.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 08 Nov 2021 02:07:32 +0100")
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Stefan Monnier <monnier@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
next prev parent reply other threads:[~2021-11-09 3:44 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-13 20:55 bug#31149: 27.0.50; (gui-get-selection nil 'text/html) returns mis-decoded text Stefan Monnier
2018-04-13 21:05 ` Lars Ingebrigtsen
2018-04-14 6:32 ` Eli Zaretskii
2018-04-24 18:11 ` Eli Zaretskii
2018-05-05 9:37 ` Eli Zaretskii
2018-05-11 9:18 ` Eli Zaretskii
2018-05-19 8:50 ` Eli Zaretskii
2019-09-29 8:44 ` Lars Ingebrigtsen
2019-09-29 9:31 ` Eli Zaretskii
2019-09-29 9:37 ` Lars Ingebrigtsen
2019-09-29 9:52 ` Eli Zaretskii
2019-09-29 10:02 ` Lars Ingebrigtsen
2019-09-29 10:21 ` Eli Zaretskii
2019-09-29 11:48 ` Lars Ingebrigtsen
2021-11-08 1:07 ` Lars Ingebrigtsen
2021-11-08 1:12 ` Lars Ingebrigtsen
2021-11-09 3:44 ` Lars Ingebrigtsen [this message]
2021-11-11 4:24 ` Lars Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sfw6t2lq.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=31149@debbugs.gnu.org \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).