[Zope3-dev] i18n, unicode, and the underline

Shane Hathaway shane@zope.com
Mon, 14 Apr 2003 12:11:01 -0400


Martijn Faassen wrote:
> Shane Hathaway wrote:
> [snip]
> 
>>Making everything aware of encodings would certainly be bad, I agree.  I 
>>intended the first interpretation.
> 
> 
> So what your saying is that all functions should make sure their output
> is unicode if they're not dealing with bytes? I guess that would be
> less programmer overhead, and it would catch mistakes with unicode
> earlier, but I see far more value in making sure I/O is handled
> well and everything inputted is already proper unicode.

That still leaves the literal string "hole", and IMHO it's a really big 
hole.  Three methods have been suggested for patching this hole: 
prefixing all literal strings with "u", calling the unicode() builtin in 
code that concatenates strings, or using 'python -U'.  Since 'python -U' 
doesn't quite work, we only have the first two options for now, and both 
are a burden for the programmer.  One requires uglifying the source, and 
the other requires deeper knowledge than we wanted to require of 
programmers.  Ouch.

sometimes-ugly-is-better-than-broken-ly y'rs, Shane