A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-April/125502.html below:

[Python-Dev] Why can't I encode/decode base64 without importing a module?

[Python-Dev] Why can't I encode/decode base64 without importing a module? [Python-Dev] Why can't I encode/decode base64 without importing a module?Lennart Regebro regebro at gmail.com
Thu Apr 25 09:03:08 CEST 2013
On Thu, Apr 25, 2013 at 8:57 AM, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> I think that would be an unfortunate result.  These operations on
> streams are theoretically nicely composable.  It would be nice if
> practice reflected that by having a uniform API for all of these
> operations (charset translation, encoded text to internal, content
> transfer encoding, compression ...).  I think it would be useful, too,
> though I can't prove that.

But the translation to and from Unicode to some 8-bit encoding is
different from the others. It makes sense that they have a different
API. If you have a Unicode string you can go:

    Unicode text -> UTF8 -> ZIP -> BASE64.

Or you can go

    Unicode text -> UTF8 -> BASE64 -> ZIP

Although admittedly that makes much less sense. :-)

But you can not go:

   Unicode text -> BASE64 -> ZIP -> UTF8

The str/bytes encoding/decoding is not like the others.

//Lennart
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4