diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/net/url_fixer_upper.cc | 2 | ||||
-rw-r--r-- | chrome/browser/net/url_fixer_upper_unittest.cc | 20 |
2 files changed, 21 insertions, 1 deletions
diff --git a/chrome/browser/net/url_fixer_upper.cc b/chrome/browser/net/url_fixer_upper.cc index 121807b..5d28a9d 100644 --- a/chrome/browser/net/url_fixer_upper.cc +++ b/chrome/browser/net/url_fixer_upper.cc @@ -265,7 +265,7 @@ string URLFixerUpper::SegmentURL(const string& text, *parts = url_parse::Parsed(); string trimmed; - TrimWhitespace(text, TRIM_ALL, &trimmed); + TrimWhitespaceUTF8(text, TRIM_ALL, &trimmed); if (trimmed.empty()) return string(); // Nothing to segment. diff --git a/chrome/browser/net/url_fixer_upper_unittest.cc b/chrome/browser/net/url_fixer_upper_unittest.cc index 1e6dbc7..b758d625 100644 --- a/chrome/browser/net/url_fixer_upper_unittest.cc +++ b/chrome/browser/net/url_fixer_upper_unittest.cc @@ -177,6 +177,26 @@ struct fixup_case { {"ftpblah.google.com", "", "http://ftpblah.google.com/"}, {"ftp", "", "http://ftp/"}, {"google.ftp.com", "", "http://google.ftp.com/"}, + // URLs which end with 0x85 (NEL in ISO-8859). + { "http://google.com/search?q=\xd0\x85", "", + "http://google.com/search?q=\xd0\x85" + }, + { "http://google.com/search?q=\xec\x97\x85", "", + "http://google.com/search?q=\xec\x97\x85" + }, + { "http://google.com/search?q=\xf0\x90\x80\x85", "", + "http://google.com/search?q=\xf0\x90\x80\x85" + }, + // URLs which end with 0xA0 (non-break space in ISO-8859). + { "http://google.com/search?q=\xd0\xa0", "", + "http://google.com/search?q=\xd0\xa0" + }, + { "http://google.com/search?q=\xec\x97\xa0", "", + "http://google.com/search?q=\xec\x97\xa0" + }, + { "http://google.com/search?q=\xf0\x90\x80\xa0", "", + "http://google.com/search?q=\xf0\x90\x80\xa0" + }, }; TEST(URLFixerUpperTest, FixupURL) { |