[docs] [issue8694] python3 FAQ mentions unicode()

Terry J. Reedy report at bugs.python.org
Fri May 14 21:34:34 CEST 2010


Terry J. Reedy <tjreedy at udel.edu> added the comment:

Yes, the faq entry has example code like
 "value = unicode(value, "utf-8")"
This whole section now applies when 'value' is a bytes or bytearray object and one calls str(value).

For portability, one should in 2.6/7 use unicode strings as much as possible and the bytes and unicode functions but not the str function. Then 2to3.py will change 'unicode' to 'str'. This should be a separate FAQ entry (if not already), for both 2.x and 3.x, with more complete advice from MLV (from whom I am parroting the above).

----------
nosy: +tjreedy

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8694>
_______________________________________


More information about the docs mailing list