summaryrefslogtreecommitdiff
path: root/searx/engines/currency_convert.py
diff options
context:
space:
mode:
authorCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-06-07 15:38:38 +0200
committerCqoicebordel <Cqoicebordel@users.noreply.github.com>2015-06-07 15:38:38 +0200
commit94567d99b35dc3822c5f5ddc593d7b0d56333098 (patch)
tree147de7ea81420500180c60daf3d4e52b65aec0e5 /searx/engines/currency_convert.py
parent4e28f12bfcc73b47f382bceedb5b65ee314674ae (diff)
downloadsearxng-94567d99b35dc3822c5f5ddc593d7b0d56333098.tar.gz
searxng-94567d99b35dc3822c5f5ddc593d7b0d56333098.zip
Allow use of chars as € in currency converter
Diffstat (limited to 'searx/engines/currency_convert.py')
-rw-r--r--searx/engines/currency_convert.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/searx/engines/currency_convert.py b/searx/engines/currency_convert.py
index 1ba4575c5..26830a167 100644
--- a/searx/engines/currency_convert.py
+++ b/searx/engines/currency_convert.py
@@ -9,7 +9,7 @@ categories = []
url = 'https://download.finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s={query}=X'
weight = 100
-parser_re = re.compile(r'^\W*(\d+(?:\.\d+)?)\W*([^.0-9].+)\W*in?\W*([^\.]+)\W*$', re.I) # noqa
+parser_re = re.compile(u'^\W*(\d+(?:\.\d+)?)\W*([^.0-9].+)\W+in?\W+([^\.]+)\W*$', re.I) # noqa
db = 1
@@ -17,7 +17,7 @@ db = 1
def normalize_name(name):
name = name.lower().replace('-', ' ')
name = re.sub(' +', ' ', name)
- return unicodedata.normalize('NFKD', u"" + name).lower()
+ return unicodedata.normalize('NFKD', name).lower()
def name_to_iso4217(name):
@@ -35,7 +35,7 @@ def iso4217_to_name(iso4217, language):
def request(query, params):
- m = parser_re.match(query)
+ m = parser_re.match(unicode(query, 'utf8'))
if not m:
# wrong query
return params