Re: [BUGREPORT] broken comments.py

"Joern P. Meier" <[email protected]> Mon, 13 Oct 2008 04:48:11 +0200
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
Hi,

Ryan Barrett schrieb:
> thanks for looking into this, guys! i'm cc'ing joern meier, who sent
> in the original patch. joern, mind helping with this?

Hmm, two things come to mind:

1) Don't encode unless the object passed in is unicode. If it is a plain
string, it already should be encoded in some encoding urlencode can deal
with (or rather: doesn't care about ;)). It makes some sense to me that
urlencode cannot deal with unicode objects, since a) URLs are not
unicode and b) it may depend on the encoding which characters will be in
the string to be urlencoded (and hence, the result might depend on the
encoding).
Well, maybe there should be no unicode objects at all at this point in
the code, only strings encoded in the default blog encoding. But I
don't know at which point in the code such encoding should be done.
Probably quite early.

2) If you use a patched comments.py with an unpatched comments.js, it
may not work, since the original comments.js doesn't encode UTF-8 correctly.

Unfortunately I cannot really verify this right now (especially whether
1 is a problem), but this is what I think about it. As for 2, it is a
problem. If UTF-8 is expected but urlencoded unicode is passed instead,
the strings cannot be decoded properly. I hope to have time to do some
further testing later this week.

Cheers,

Joern

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/