unicode links in wikklytext

3 views
Skip to first unread message

chris...@gmail.com

unread,
Sep 30, 2010, 10:51:47 AM9/30/10
to WikklyText
If a page title is unicode, when it is rendered the url quoting will
error out as it expects a str not a unicode.

This seems to fix it (this is 1.6.0) I believe:

-=-=-
--- wikklytextrender.py 2010-09-30 15:50:23.000000000 +0100
+++ /Library/Python/2.6/site-packages/tiddlywebplugins/
wikklytextrender.py 2010-09-30 15:44:41.000000000 +0100
@@ -41,6 +41,10 @@
"""
if '://' in url_fragment or url_fragment.startswith('/'):
return url_fragment, True
+ try:
+ url_fragment = url_fragment.encode('utf-8')
+ except UnicodeEncodeError:
+ pass
return '%s%s' % (base_url, urllib.quote(url_fragment,
safe='')), False

posthook = PostHook()
-=-=-

chris...@gmail.com

unread,
Sep 30, 2010, 11:13:11 AM9/30/10
to WikklyText
Sorry, I'm clearly not awake, this is not even your code, it's my
code!

Hah. Sorry for the interruption.

Things are working great here.

Frank McIngvale

unread,
Sep 30, 2010, 11:38:22 AM9/30/10
to wikkl...@googlegroups.com
Heh ... glad you noticed because I would have started debugging it
tonight not realizing it either :-)

Frank

> --
> You received this message because you are subscribed to the Google Groups "WikklyText" group.
> To post to this group, send email to wikkl...@googlegroups.com.
> To unsubscribe from this group, send email to wikklytext+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/wikklytext?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages