A few days ago when using Kid with TurboGears I spent many hours
trying to correct the following problem:

File "/usr/lib/python2.4/site-packages/kid-0.8-py2.4.egg/kid/pull.py",
line 187, in to_unicode
    return unicode(value, encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position
3: ordinal not in range(128)

I'm sure you have all seen it before. The reason why this problem was
so very frustrating for me was because my webapp seemed to work
fine... Until I did something. And something was ofcourse to try and
get Kid to output non-ascii characters. Ofcourse, the traceback wasn't
very useful and it took me a couple of hours to figure out what
TurboKid was complaining about. Then a few more hours to find out that
nothing was wrong with my program and all I needed was to set
defaultencoding in sitecustomize.py to utf8.

I think that Kid's way to deal with encodings is slightly
non-optimal..  It could be improved by having Kid default to utf8
instead of ascii. It is likely that that brings other problems, but it
is still better than guessing ascii which in a web context is a
totally brain damaged guess. I'm sure there are alot of web apps out
there waiting to be broken because the programmer didn't realise that
his code only works with ascii characters.

My other idea is that Kid would refuse to run unless an encoding is
explicitly specified somewhere. "In the face of ambiguity, refuse the
temptation to guess." I hope you can please fix this problem somehow.
Please CC me replies as I don't subscribe.

--
mvh Björn


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid3432&bid#0486&dat1642
_______________________________________________
kid-template-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to