On Fri, May 23, 2008 at 6:18 AM, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>>> 2. If you don't want any non-ASCII printed to a file, set the file's >>> encoding to ASCII and the error handler to backslashescape. > > On Thu, May 22, 2008 at 12:59 PM, Antoine Pitrou <[EMAIL PROTECTED]> wrote: >> Since some people still seem wary that repr() might return non-ascii >> results, perhaps we could also: >> >> 3. Add a builtin function named ascii() and a formatting code "%a" that >> both call repr() internally and then convert all non-ascii characters to >> \uXXXX escapes. > > I'd call that a stretch goal, but it seems an easy one. Martin may against for new builtin function. Perhaps string.asciirepr() might better? > > Could someone (Atsuo?) write up a new version for the PEP, adding the > conclusions reached in this thread and recapping some of the > discussion? I think this can get in before the first beta release, and > that seems doable. > I'll revise the PEP and the patch soon. One point still remains is default error handler for sys.stdout. I can live with 'strict' error handler, but I think raising exceptions for evenry un-supported characters by default is too exacting. _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com