lemburg mbuegenixcom 20080506 0256 atsuo ishimoto wrote ive written pep new string representation python 3000 patch updated httpbugspythonorgissue2630 guido updated patch rietveld httpcodereviewappspotcom767 would appreciate comments help specification algorithm build repr strings changed convert cr lf tab r n convert nonprintable ascii characters0x000x1f 0x7f xxx convert leading surrogate pair characters without trailing character 0xd8000xdbff followed 0xdc000xdfff uxxxx convert unicode whitespace ascii spacex20 control characters categories z c unicode database xxx uxxxx u00xxxxxx set unicode errorhandler sysstdout sysstderr backslashreplace default sysstderr may make sense override error reporting encoding problems 0 sysstdout doesnt make sense since hides encoding errors applications using sysstdout piping mechanism 1 really way beyond scope pep dont really see need also dont cover cases write repr log file stream syslog id 1 making error handling sysstdout sysstderr user adjustable printable characters unicode standard doesnt define nonprintable characters must create definition propose define nonprintable characters follows nonprintable ascii characters python 2 broken surrogate pair characters characters defined unicode character database cc control cf format cs surrogate co private use cn assigned zl separator line u2028 line separator zp separator paragraph u2029 paragraph separator zs separator space ascii spacex20 characters category escaped avoid ambiguity nice means whole unicode database loaded every time interpreter starts indicated ticket im firmly 1 weve taken great care py2x moving database module thats imported needed would really silly get unicode repr processed btw im sure possible break set ranges switch cases easy test without lookup code points database even end using database imported repr really need lookup code points outside latin1 range alternate solutions help debugging nonlatin languages without changing repr suggestion made make encoding used unicode_repr adjustable benefit preserving current repr behavior make applicationlibrary authors aware nonascii repr selecting encoding printing flexible global setting im sure saying proposed make unicode repr output regular encoding thats implemented codec could easily change encoding whatever need application console marcandre lemburg egenixcom professional python services directly source 1 may 06 2008 pythonzope consulting support httpwwwegenixcom mxodbczopedatabaseadapter httpzopeegenixcom mxodbc mxdatetime mxtexttools httppythonegenixcom ________________________________________________________________________ try mxodbczopeda windowslinuxsolarismacosx free egenixcom software skills services gmbh pastorloehstr48 d40764 langenfeld germany ceo diplmath marcandre lemburg registered amtsgericht duesseldorf hrb 46611 _______________________________________________ python3000 mailing list smsbmo9552pythonorg httpmailpythonorgmailmanlistinfopython3000 unsubscribe httpmailpythonorgmailmanoptionspython3000python300040tangomucom fri 08 aug 2008 145803 0200 python3000 pep 3108 string representation python 3000