From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Encoding multibyte strings Date: Fri, 08 Apr 2016 10:28:38 +0300 Message-ID: <83wpo8k195.fsf@gnu.org> References: <87egagh8zg.fsf@ericabrahamsen.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1460100560 2024 80.91.229.3 (8 Apr 2016 07:29:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 8 Apr 2016 07:29:20 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Apr 08 09:29:19 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aoQr0-00035V-3A for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Apr 2016 09:29:18 +0200 Original-Received: from localhost ([::1]:54578 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoQqu-0003T1-Fo for geh-help-gnu-emacs@m.gmane.org; Fri, 08 Apr 2016 03:29:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52357) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoQqe-0003Pp-Sz for help-gnu-emacs@gnu.org; Fri, 08 Apr 2016 03:28:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aoQqb-0005l9-Cn for help-gnu-emacs@gnu.org; Fri, 08 Apr 2016 03:28:56 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:56011) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aoQqb-0005l5-9h for help-gnu-emacs@gnu.org; Fri, 08 Apr 2016 03:28:53 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3856 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1aoQqa-0004iQ-JZ for help-gnu-emacs@gnu.org; Fri, 08 Apr 2016 03:28:53 -0400 In-reply-to: <87egagh8zg.fsf@ericabrahamsen.net> (message from Eric Abrahamsen on Fri, 08 Apr 2016 15:09:55 +0800) 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: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:109736 Archived-At: > From: Eric Abrahamsen > Date: Fri, 08 Apr 2016 15:09:55 +0800 > > I'm trying to get from this: > > 陈冬梅 > > to this: > > CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:=E9=99=88=E5=86=AC=E6=A2=85 > > Assuming that the original characters were in utf-8, of course. So that > 陈 is =E9=99=88, and so on. > > I got this string by looking at a Vcard export from the Contacts app on > my Android phone. I'm trying to take an Emacs buffer and turn it into a > *.vcf card file to import into the same app -- basically I'm trying to > reverse-engineer the VCard encoding format so I can create a file to > feed to my phone. > > I'm 99.9% sure that Emacs already comes with functions that will produce > my escaped coded string, but after many adventures with C-h f (during > which I learned quite a few unrelated tricks) I haven't found it. Can > someone enlighten me as to what the simplest way to do this is? Not sure what exactly are you looking for. A wild guess is that (encode-coding-string 'utf-8 STRING) and (quoted-printable-encode-string STRING) will do the job, IIUC.