unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* base64-encoding-region does not work on multibyte character
@ 2012-04-08  5:15 Moses
  0 siblings, 0 replies; 3+ messages in thread
From: Moses @ 2012-04-08  5:15 UTC (permalink / raw)
  To: Gnu Emacs Help

Hi all,

I get error "Multibyte character in data for base64 encoding" when I
try to base64 encoding some utf-8 text. I would like to know is there
an easy way to encode and decode base64 in Emacs?

Thanks



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: base64-encoding-region does not work on multibyte character
       [not found] <mailman.716.1333862142.20052.help-gnu-emacs@gnu.org>
@ 2012-04-10  2:43 ` Stefan Monnier
  2012-05-18  3:21   ` Moses
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Monnier @ 2012-04-10  2:43 UTC (permalink / raw)
  To: help-gnu-emacs

> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: base64-encoding-region does not work on multibyte character
  2012-04-10  2:43 ` base64-encoding-region does not work on multibyte character Stefan Monnier
@ 2012-05-18  3:21   ` Moses
  0 siblings, 0 replies; 3+ messages in thread
From: Moses @ 2012-05-18  3:21 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Ok, it is not as convenient as in Notepad++, but it works.

Thanks.

On Tue, Apr 10, 2012 at 10:43 AM, Stefan Monnier
<monnier@iro.umontreal.ca> 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.  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-18  3:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.716.1333862142.20052.help-gnu-emacs@gnu.org>
2012-04-10  2:43 ` base64-encoding-region does not work on multibyte character Stefan Monnier
2012-05-18  3:21   ` Moses
2012-04-08  5:15 Moses

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).