From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: base64-encoding-region does not work on multibyte character Date: Mon, 09 Apr 2012 22:43:52 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1334025914 11876 80.91.229.3 (10 Apr 2012 02:45:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 10 Apr 2012 02:45:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 10 04:45:13 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 1SHR4z-0005cs-HY for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Apr 2012 04:45:13 +0200 Original-Received: from localhost ([::1]:47802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHR4y-00055o-RT for geh-help-gnu-emacs@m.gmane.org; Mon, 09 Apr 2012 22:45:12 -0400 Original-Path: usenet.stanford.edu!postnews.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe02.iad.POSTED!00000000!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.94 (gnu/linux) Cancel-Lock: sha1:VnK6j4AmMRP3VNZ4UcbjzfpbpN8= Original-Lines: 10 Original-X-Complaints-To: abuse@UsenetServer.com Original-NNTP-Posting-Date: Tue, 10 Apr 2012 02:43:53 UTC X-Received-Bytes: 1094 Original-Xref: usenet.stanford.edu gnu.emacs.help:191992 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:84407 Archived-At: > 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. So you first need to encode your sequence of chars into a sequence of bytes using some coding-system. I.e. apply `encode-coding-string/region'. And after that, you can use base64-encode-string/region. Stefan