[Python-Dev] urllib.quote and unquote - Unicode issues (original) (raw)
Bill Janssen janssen at parc.com
Sun Jul 13 22:36:06 CEST 2008
- Previous message: [Python-Dev] urllib.quote and unquote - Unicode issues
- Next message: [Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Ah there may be some confusion here. We're only dealing with str->str transformations (which in Python 3 means Unicode strings). You can't put a bytes in or get a bytes out of either of these functions. I suggested a "quoteraw" and "unquoteraw" function which would let you do this.
Ah, well, that's a problem. Clearly the unquote is str->bytes, while the quote is (bytes OR str)->str. You can't pass a Unicode string back as the result of unquote without passing in an encoding specifier, because the character set is application-specific.
Bill
- Previous message: [Python-Dev] urllib.quote and unquote - Unicode issues
- Next message: [Python-Dev] unittest's redundant assertions: asserts vs. failIf/Unlesses
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]