[Python-Dev] Bytes path related questions for Guido
Glenn Linderman
v+python at g.nevcal.com
Wed Aug 27 20:21:06 CEST 2014
More information about the Python-Dev mailing list
Wed Aug 27 20:21:06 CEST 2014
- Previous message: [Python-Dev] Bytes path related questions for Guido
- Next message: [Python-Dev] Bytes path related questions for Guido
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 8/26/2014 4:31 AM, MRAB wrote: > On 2014-08-26 03:11, Stephen J. Turnbull wrote: >> Nick Coghlan writes: >> >> > "purge_surrogate_escapes" was the other term that occurred to me. >> >> "purge" suggests removal, not replacement. That may be useful too. >> >> neutralize_surrogate_escapes(s, remove=False, replacement='\uFFFD') >> > How about: > > replace_surrogate_escapes(s, replacement='\uFFFD') > > If you want them removed, just pass an empty string as the replacement. And further, replacement could be a vector of 128 characters, to do immediate transcoding, or a single character to do wholesale replacement with some gibberish character, or None to remove (or an empty string). -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20140827/bfa142d1/attachment-0001.html>
- Previous message: [Python-Dev] Bytes path related questions for Guido
- Next message: [Python-Dev] Bytes path related questions for Guido
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list