Guido van Rossum wrote: > On 2/13/06, Phillip J. Eby <pje at telecommunity.com> wrote: > >>At 04:29 PM 2/13/2006 -0800, Guido van Rossum wrote: >> >>>On 2/13/06, Phillip J. Eby <pje at telecommunity.com> wrote: >>> >>>What would bytes("abc\xf0", "latin-1") *mean*? >> >>I'm saying that XXX would be the same encoding as you specified. i.e., >>including an encoding means you are encoding the *meaning* of the string. No, this is wrong. As I understand it, the encoding argument to bytes() is meant to specify how to *encode* characters into the bytes object. If you want to be able to specify how to *decode* a str argument as well, you'd need a third argument. -- Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | Carpe post meridiam! | Christchurch, New Zealand | (I'm not a morning person.) | greg.ewing at canterbury.ac.nz +--------------------------------------+
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