Greg Ewing <[EMAIL PROTECTED]> wrote: > > Stephen J. Turnbull wrote: > > > What I advocate for Python is to require that the standard base64 > > codec be defined only on bytes, and always produce bytes. > > I don't understand that. It seems quite clear to me that > base64 encoding (in the general sense of encoding, not the > unicode sense) takes binary data (bytes) and produces characters. > That's the whole point of base64 -- so you can send arbitrary > data over a channel that is only capable of dealing with > characters. > > So in Py3k the correct usage would be > > base64 unicode > encode encode(x) > original bytes --------> unicode ---------> bytes for transmission > <-------- <--------- > base64 unicode > decode decode(x) > > where x is whatever unicode encoding the transmission > channel uses for characters (probably ascii or an ascii > superset, but not necessarily).
It doesn't seem strange to you to need to encode data twice to be able to have a usable sequence of characters which can be embedded in an effectively 7-bit email; when base64 was, dare I say it, designed to have 7-bit email as its destination in the first place? It does to me. - Josiah _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com