This does not change anything for tinyurl (the default), but allows
using http://tinyarro.ws/api-create.php?utfpure=1&url=
In case invalid characters are encountered, fall back to str.
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
# Didn't get a retrieval error or 404 on the web
# view, so try to tinyify a reference to it.
self.url = open(urllib.urlretrieve(self.tinyifier + webview)[0]).read()
+ try:
+ self.url = self.url.decode('UTF-8')
+ except UnicodeError:
+ pass
except IOError:
self.url = webview
else: