[Web-SIG] WSGI configuration and character encoding.

Alan Kennedy py-web-sig at xhaus.com
Tue Nov 30 20:27:50 CET 2004


[Alan Kennedy]
 >> I'm really, really, really, really, *really* against us trying to
 >> come up with our own solution to the encoding problem. There are just
 >> too many pitfalls and special cases.

[Phillip J. Eby]
 > You've lost me here.  I was suggesting that we use PEP 263 or a subset
 > thereof.  I've seen the patches for PEP 263, and they're pretty darn
 > simple, even in C!

Sorry, I've obviously misunderstood. I thought you were talking about 
devising a new encoding solution/mechanism/implementation. I didn't 
realise that you were proposing actually using the 
algorithm/implementation from PEP-263.

Partly, this would have been because I thought (mistakenly?) that the 
PEP-263 implementation was not available from pure python code? CF this 
recent thread on python-list.

PEP263 + exec statement
http://mail.python.org/pipermail/python-list/2004-November/252330.html

But even if implementors have to code the algorithm themselves, (short 
enough to present in PEP-333?), I'm +0.5 on that if the implementation 
is as simple/straightforward as Phillip says it is (even in c ;-)

But my unreserved support is reserved for

[James Y Knight]
 > 4. Declare that the encoding is simply always UTF-8.

+1!

I'd also be happy with

# encoding:windows-1252
[server]
webmaster: aláin_ó_cinnéide at spam.org

That looks simple and works well.

Lastly, I had forgotten that

  [Alan's wild and ugly proposal to address the encoding problem .. snipped]

 > .. introduces all the problems of < > & &quot, too.

I do find < & " & ' & > particularly annoying when 
writing python, javascript or even xpath inside xslt files.

Regards,

Alan.



More information about the Web-SIG mailing list