[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: possible bug in quoted-printable-decode region
From: |
Yuri Khan |
Subject: |
Re: possible bug in quoted-printable-decode region |
Date: |
Wed, 27 Jun 2018 15:40:53 +0700 |
On Wed, Jun 27, 2018 at 3:10 PM Uwe Brauer <address@hidden> wrote:
> Maybe I am missing something elementary here. I came across with a file
> which still had quoted printable encoding like this
>
> Buenas d=C3=ADas:
>
> So I used
> (quoted-printable-decode-region (region-beginning) (region-end) nil)
>
> But I obtained the following
>
> Buedas d\303\255as:
quoted-printable-decode-region gives you a byte string. You are then
supposed to decode that into text using whichever character encoding
you know is used. (Quoted-printable encoding, unlike URL
percent-encoding, does not mandate UTF-8. In RFC 2822 mail, the
character encoding will be given in the Content-Type header’s charset=
parameter. =C3=AD looks like a quoted-printable encoding of UTF-8
encoding of the character U+00ED LATIN SMALL LETTER I WITH ACUTE.)
As a shortcut, you could pass the character encoding as the last
argument to q-p-d-r, but that is described as deprecated in the
docstring.