Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(714)

Unified Diff: components/search_engines/template_url.cc

Issue 1238683003: Unpunycode search keywords and short names. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Remove UTF-8 from source code, use std::string(). Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/search_engines/template_url.cc
diff --git a/components/search_engines/template_url.cc b/components/search_engines/template_url.cc
index 8202fa4483c0d7d0569b9bf5da797ff44b1c2f26..9cb82c82d3a768f9261d796b3ce9214cf67b5e52 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -1217,7 +1217,9 @@ base::string16 TemplateURL::GenerateKeyword(const GURL& url) {
// Special case: if the host was exactly "www." (not sure this can happen but
// perhaps with some weird intranet and custom DNS server?), ensure we at
// least don't return the empty string.
- base::string16 keyword(net::StripWWWFromHost(url));
+ // We do not want any punycode in any language.
Matt Giuca 2015/07/17 04:13:11 This comment should be more detailed and should re
alshabalin 2015/07/20 14:06:37 Done.
+ base::string16 keyword(
+ net::StripWWW(net::IDNToUnicode(url.host(), std::string())));
return keyword.empty() ? base::ASCIIToUTF16("www") : keyword;
}

Powered by Google App Engine
This is Rietveld 408576698