Message150040
| Author |
vstinner |
| Recipients |
benjamin.peterson, gz, pitrou, poolie, r.david.murray, vila, vstinner |
| Date |
2011年12月21日.20:04:43 |
| SpamBayes Score |
3.1247411e-09 |
| Marked as misclassified |
No |
| Message-id |
<1324497884.3.0.0325051788672.issue13643@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
> it will still be passing values that can't be
> interpreted by other processes as you highlighed earlier.
On UNIX, data going outside Python has be be encoded: you pass byte strings, not directly Unicode. Surrogates are encoded back to original bytes.
Example:
>>> b'a\xff'.decode('ascii', 'surrogateescape')
'a\udcff'
>>> b'a\xff'.decode('ascii', 'surrogateescape').encode('ascii', 'surrogateescape')
b'a\xff' |
|