Unicode surrogate pairs (Python 3.4)

Chris Angelico rosuav at gmail.com
Sun May 3 12:47:36 EDT 2015


On Mon, May 4, 2015 at 2:30 AM, Jon Ribbens
<jon+usenet at unequivocal.co.uk> wrote:
> I did some experimentation, and it looks like the answer is:
>
>   "\udb40\udd9d".encode("utf16", "surrogatepass").decode("utf16")
>
> Thanks for your help!

Ha! That's the one. I went poking around but couldn't find the name
for it. That's exactly the sloppy encoding that I was talking about.

ChrisA



More information about the Python-list mailing list