On Feb 5, 2007, at 5:17 PM, Neil Schemenauer wrote: > David Bingerwrote: >>>>> str(h8(u'\u1234')) >> '\xe1\x88\xb4' >> (this is the utf8 encoding of \u1234.) > > Do you sliently decode too? IOW, what does, > > h8('\xe1\x88\xb4') > > produce? I guess that's convenient but it would make encoding bugs > very difficult to find. Yes. The default decoding of qpy is utf-8. That's what the '8' is for. If the caller provides a str instance, it better be a utf-8 encoding.