unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: master 396355f: Re-fix charset issues when yanking non-plain-text elements
Date: Thu, 11 Nov 2021 12:54:17 +0100	[thread overview]
Message-ID: <87mtma7vrq.fsf@gnus.org> (raw)
In-Reply-To: <83mtmb0wiv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Nov 2021 13:19:52 +0200")

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	other threads:[~2021-11-11 11:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11 11:19 master 396355f: Re-fix charset issues when yanking non-plain-text elements Eli Zaretskii
2021-11-11 11:54 ` Lars Ingebrigtsen [this message]
2021-11-11 14:05   ` Eli Zaretskii
2021-11-12  2:45     ` Lars Ingebrigtsen
2021-11-12  8:55       ` Eli Zaretskii

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=87mtma7vrq.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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).