make .dict handle unicode properly

This commit is contained in:
Ryan Hitchman 2010-07-24 17:38:28 -06:00
parent 76341b5e6e
commit b5be0217a4
1 changed files with 5 additions and 1 deletions

View File

@ -5,7 +5,7 @@ import urllib
import urllib2
import urlparse
from urllib import quote, quote_plus
from urllib import quote, quote_plus as _quote_plus
from urllib2 import HTTPError, URLError
from lxml import etree, html
@ -67,3 +67,7 @@ def to_utf8(s):
return s
else:
return s.encode('utf8', 'ignore')
def quote_plus(s):
return _quote_plus(to_utf8(s))