Chromium Code Reviews
Description[raw_io] prevent output_text from returning `unicode` object.
Because of python2's awkward handling of unicode, it's better to use
`str` and just "know" that it contains utf-8 encoded data. output_text
will still ensure that the returned data is valid utf-8 (by round-tripping
the original raw bytes with decode/encode), and so is different than
raw_io.output (which does no encoding/decoding whatsoever).
The only codepages which we've ever supported have been ASCII and UTF-8
anyway, and since ASCII is a strict subset of UTF-8, this is a reasonable
approach.
R=martiniss@chromium.org, nodir@chromium.org
BUG=689886
Review-Url: https://codereview.chromium.org/2678343010
Committed: https://github.com/luci/recipes-py/commit/0aa2b6364faf52b0536c37534efc4574708cecd6
Patch Set 1 #
Messages
Total messages: 10 (5 generated)
|
|||||||||||||||||||