[PATCH] Decode patch from UTF-8 while parsing from stdin

Guilherme Salgado guilherme.salgado at linaro.org
Thu Feb 10 23:02:46 EST 2011

On Thu, 2011-02-10 at 06:33 +0100, martin f. krafft wrote:
> also sprach Jeremy Kerr <jk at ozlabs.org> [2011.02.10.0418 +0100]:
> > I'm also having trouble finding where parse_patch will be passed
> > anything but unicode.
> Exactly; hence it should treat the text as Unicode and decode it
> before manipulating it.

If indeed parse_patch() will only be passed unicode objects, having it
call text.decode('utf8') is wrong because that will cause an implicit
encoding of text using the default codec (ascii), which will fail if
text has any non-ascii characters.

Guilherme Salgado <https://launchpad.net/~salgado>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/patchwork/attachments/20110210/390812e5/attachment.pgp>

More information about the Patchwork mailing list