[Python-ideas] Add "namereplace" error handler

Nick Coghlan ncoghlan at gmail.com
Tue Jun 11 14:37:53 CEST 2013


On 11 June 2013 22:01, Victor Stinner <victor.stinner at gmail.com> wrote:
> 2013/6/11 Serhiy Storchaka <storchaka at gmail.com>:
>> I propose to add "namereplace" error handler which is similar to
>> "backslashreplace" error handler but use \N escapes instead of \x/\u/\U
>> escapes.
>> ...
>> What are you think about this? Are there suggestions for better name?
>
> I like your idea (+1). For the name, I propose "unicodename":
>
> str.encode('ascii', 'unicodename")
>
> But I like "namereplace".

+1 from me for "namereplace" (it fits well with the existing
"<output>replace" naming scheme for the encoding-only error handlers:
xmlcharrefreplace and backslashreplace)

Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-ideas mailing list