5 ms·
For decoding a byte string, I prefer bytes.decode("utf8"). Note that decode takes an optional second argument that says what to do if an invalid byte sequence i
by js2 15y ago
For decoding a byte string, I prefer bytes.decode("utf8"). Note that decode takes an optional second argument that says what to do if an invalid byte sequence is encountered - by default an exception is raised.
Also, I think http://docs.python.org/howto/unicode.html http://docs.python.org/howto/unicode.html may be a better reference than this article.