RFC: make ~/.bzr.log utf8
Robert Collins
robertc at robertcollins.net
Sat Dec 5 22:59:15 GMT 2009
On Sat, 2009-12-05 at 16:25 -0600, John Arbash Meinel wrote:
> So something like:
>
> if type(bytes) is unicode:
> outf.write(bytes.encode('utf-8')
> elif type(bytes) is str:
> try:
> bytes.decode('utf8')
> except UnicodeDecodeError:
> outf.write(bytes.encode('string_escape'))
> else:
> outf.write(bytes) # it is utf-8 compatible
> else:
> ???
Ah yes, I've been getting spoilt by doing stuff in environments where
bytes are not strings. Sigh.
I'd like to push this higher up, but making nothing pass in plain bytes
to mutter etc may be a lot of work, so your suggestion looks sensible.
-Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20091206/b4004ec3/attachment.pgp
More information about the bazaar
mailing list