From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: possible bug in quoted-printable-decode region Date: Thu, 28 Jun 2018 16:14:11 +0300 Message-ID: <83efgroxy4.fsf@gnu.org> References: <87bmbwlkfs.fsf@mat.ucm.es> <87a7rf9jkb.fsf@mat.ucm.es> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1530191574 4137 195.159.176.226 (28 Jun 2018 13:12:54 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 28 Jun 2018 13:12:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: Uwe Brauer Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 28 15:12:50 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fYWjC-0000xw-1B for ged-emacs-devel@m.gmane.org; Thu, 28 Jun 2018 15:12:50 +0200 Original-Received: from localhost ([::1]:36636 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYWlJ-0006fe-6x for ged-emacs-devel@m.gmane.org; Thu, 28 Jun 2018 09:15:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYWkV-0006FK-Cd for emacs-devel@gnu.org; Thu, 28 Jun 2018 09:14:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fYWkR-0003RG-Hz for emacs-devel@gnu.org; Thu, 28 Jun 2018 09:14:11 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:39435) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fYWkR-0003R2-DX; Thu, 28 Jun 2018 09:14:07 -0400 Original-Received: from [176.228.60.248] (port=3316 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fYWkO-00031q-GU; Thu, 28 Jun 2018 09:14:05 -0400 In-reply-to: <87a7rf9jkb.fsf@mat.ucm.es> (message from Uwe Brauer on Thu, 28 Jun 2018 14:33:56 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:226805 Archived-At: > From: Uwe Brauer > Date: Thu, 28 Jun 2018 14:33:56 +0200 > > > 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. > > > Thanks, but now I am confused. I have that file, with > Buenas d=C3=ADas: > > How can I translate/decode that to latin1 or utf8? Or are you saying > that this is not possible. It's possible: you should follow quoted-printable-decode-region with decode-coding-region, and pass it a suitable coding-system. > Still don't know what to do if the file had no mail header. You will have to guess the encoding somehow. Emacs cannot (and shouldn't in this case).