[Python-Dev] Non-ASCII characters in test_pep277.py in 2.3

Guido van Rossum guido@python.org
Mon, 07 Oct 2002 08:20:27 -0400


> > The file pep_2777.py uses an encoding cookie that specifies UTF-8.
> > Unfortunately my toolchain doesn't know about this, and displays it as
> > Latin-1.  
> 
> What do you mean by "toolchain"? At the end of the chain is python, it
> should know about this well enough.
> 
> Did you try to open the file in IDLE? What other tools are you using?

XEmacs.  The particular version or configuration I'm using apparently
doesn't recogize the coding cookie.

> > Since the only UTF-8 is in 8-bit string literals (not Unicode
> > literals), wouldn't it make more sense to drop the encoding cookie
> > and use \xXX escapes in those literals?
> 
> Having the original byte strings allows to verify correctness of the
> test visually: the files created should look the same in the operating
> system (using ls, or a file explorer) as they do in the source code.

You could do this with a comment.

--Guido van Rossum (home page: http://www.python.org/~guido/)