Already exists. Has for quite a while now:
the_unicode = unicode(some_bytes, "name of encoding")
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
>
> Thanks for your help.
>
> _______________________________________________
> Python-3000 mailing list
> Pytho...@python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe:
> http://mail.python.org/mailman/options/python-3000/cvrebert%40gmail.com
>
>
_______________________________________________
Python-3000 mailing list
Pytho...@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: http://mail.python.org/mailman/options/python-3000/python-3000-garchive-63646%40googlegroups.com
a) I discourage usage of unicode and str converters; consider using
.encode/.decode instead
b) unicode is now called str
Regards,
Martin
Replace "unicode" with "str" in my line of code and I think it should work.
Cheers,
Chris
unicode becomes str in Py3k (as "type('')" will tell you).
bytes.decode() works as well.
Use str.encode() to go the other way.
Cheers,
Nick.
--
Nick Coghlan | ncog...@gmail.com | Brisbane, Australia
---------------------------------------------------------------