From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Moses Newsgroups: gmane.emacs.help Subject: Re: base64-encoding-region does not work on multibyte character Date: Fri, 18 May 2012 11:21:45 +0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1337311354 21450 80.91.229.3 (18 May 2012 03:22:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 May 2012 03:22:34 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 18 05:22:33 2012 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 1SVDlq-0004uN-Gj for geh-help-gnu-emacs@m.gmane.org; Fri, 18 May 2012 05:22:26 +0200 Original-Received: from localhost ([::1]:36188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVDlp-0005Mc-Pz for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2012 23:22:25 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVDlk-0005MR-7l for help-gnu-emacs@gnu.org; Thu, 17 May 2012 23:22:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SVDli-0003CF-Iz for help-gnu-emacs@gnu.org; Thu, 17 May 2012 23:22:19 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:42748) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SVDli-0003Bh-9h for help-gnu-emacs@gnu.org; Thu, 17 May 2012 23:22:18 -0400 Original-Received: by wefh52 with SMTP id h52so2015654wef.0 for ; Thu, 17 May 2012 20:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=Ljbu5PQL2KbQDc9IzRTgNAszUXSDm2t0tKM1sIpV5RQ=; b=f4TWsjgQz3zuXx5E/So5FY1cwW62K03xgKXJII5XyjFgEUmcilOAYTRn28VxWzo+4G 7/jUo3y2QP8DNSfMFUXthKekOP0sk1W4Hp1Q0A0q+VAJINPY1vAU6SpVG7ixACJ8BNzC Qgw3gYmz53xH4P4/ZxoJAl2UQA8AmRitK/D+1lkrWdM3qRhsruT4/tOVUZ76GKWrcQKE 2iP2IQoNl+KwF3oJ5VeeTv4RWUPPDiABc244UFyqvjYW5PRVcsgWYz+KvC0YUDdYCcLy /qa/TNkzsFKlCppyRxCWrCHNQn37u27HsLwe1tqSHPM+n9XSFHAb2gwaZzAFX06b0g36 eF8w== Original-Received: by 10.180.78.105 with SMTP id a9mr55737131wix.20.1337311335550; Thu, 17 May 2012 20:22:15 -0700 (PDT) Original-Received: by 10.216.162.20 with HTTP; Thu, 17 May 2012 20:21:45 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84867 Archived-At: Ok, it is not as convenient as in Notepad++, but it works. Thanks. On Tue, Apr 10, 2012 at 10:43 AM, Stefan Monnier wrote: >> I get error "Multibyte character in data for base64 encoding" when I >> try to base64 encoding some utf-8 text. > > base64 is an encoding which applies to *bytes*, not chars. =A0So you firs= t > need to encode your sequence of chars into a sequence of bytes using > some coding-system. =A0I.e. apply `encode-coding-string/region'. > And after that, you can use base64-encode-string/region. > > > =A0 =A0 =A0 =A0Stefan