From fa6c2b54d71342eee5ca478fb5f1c2ba27ae6d1b Mon Sep 17 00:00:00 2001 From: Henrik Baard Date: Thu, 31 Mar 2011 10:47:21 +0200 Subject: Error in search engine script The script that generates the search engine xml file all_search_engines.xml contains an error when handling unicodes. The matching \\x([a-fA-F0-9]+) matches to many characters, for example Espa\x00f1a will incorrectly become ༚ instead of ña. Make script match between 1 and 4 chars instead of 1 to many. FIX=DMS01020910 Change-Id: I79a33b873e13698e17bd20da64152abcdd498bc0 --- res/values/all_search_engines.xml | 4 ++-- tools/get_search_engines.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/res/values/all_search_engines.xml b/res/values/all_search_engines.xml index 08cf763..c8880c4 100644 --- a/res/values/all_search_engines.xml +++ b/res/values/all_search_engines.xml @@ -157,7 +157,7 @@ http://www.opensearch.org/Specifications/OpenSearch/1.1/Draft_4#OpenSearch_1.1_p - Ask.com Espa༚ + Ask.com España es.ask.com http://es.ask.com/favicon.ico http://es.ask.com/web?q={searchTerms} @@ -357,7 +357,7 @@ http://www.opensearch.org/Specifications/OpenSearch/1.1/Draft_4#OpenSearch_1.1_p http://api.bing.com/osjson.aspx?query={searchTerms}&language={language} - Yahoo! Espa༚ + Yahoo! España es.yahoo.com http://es.search.yahoo.com/favicon.ico http://es.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms} diff --git a/tools/get_search_engines.py b/tools/get_search_engines.py index cd73423..8ac9b6f 100755 --- a/tools/get_search_engines.py +++ b/tools/get_search_engines.py @@ -87,7 +87,7 @@ class SearchEngineManager(object): str = str.strip('"') str = str.replace('&', '&').replace('<', '<').replace('>', '>') str = str.replace('"', '"').replace('\'', ''') - str = re.sub(r'\\x([a-fA-F0-9]+)', r'&#x\1;', str) + str = re.sub(r'\\x([a-fA-F0-9]{1,4})', r'&#x\1;', str) return str -- cgit v1.1