emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 396355f: Re-fix charset issues when yanking non-plain-text el


From: Lars Ingebrigtsen
Subject: Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements
Date: Thu, 11 Nov 2021 12:54:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

> The old code took the data-type from the value of the
> foreign-selection property, but now we disregard that.  Is that on
> purpose?

Yes.  That made even binary data (like images) be mis-decoded.

Perhaps the logic here should be changed altogether -- and make all the
backend selection functions do the decoding themselves (since the
Windows one does it).

>> +                    ;; Guess at the charset for types like text/html
>> +                    ;; -- it can be anything, and different
>> +                    ;; applications use different encodings.
>> +                    ((string-match-p "\\`text/" (symbol-name data-type))
>> +                     (decode-coding-string
>> +                      data (car (detect-coding-string data))))
>
> Did you really need the explicit call to detect-coding-string?  AFAIR,
> decode-coding-string does that automatically if needed.  Did that fail
> in some case?

Can you give a nil to decode-coding-string as the coding system?  It's
not documented.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]