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


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 31149 <at> debbugs.gnu.org, monnier <at> IRO.UMontreal.CA
Subject: bug#31149: 27.0.50; (gui-get-selection nil 'text/html) returns mis-decoded text
Date: Sun, 29 Sep 2019 12:31:58 +0300
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Sun, 29 Sep 2019 10:44:48 +0200
> Cc: 31149 <at> debbugs.gnu.org
> 
> >     if (html != None && sel_type == html) {
> > 	/* if the buffer contains UCS-2 (UTF-16), convert to
> > 	 * UTF-8.  Mozilla-based browsers do this for the
> > 	 * text/html target.
> > 	 */
> >     [...]
> >
> > and according to the subsequent code it's not even always the
> > same endianness.
> 
> I think it would make sense for us to do the same here.  It should be
> easy enough for us to detect that the string is utf-16, I think?

I think you want to use auto-coding-regexp-alist-lookup.

> The data has a BOM

Does it?  It doesn't have to, at least not in principle.




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

Previous Next


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