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

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: Rebased to origin/master. 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..2be8e778502e655c6fc9e2da3a2d86892112d859 100644
--- a/components/search_engines/template_url.cc
+++ b/components/search_engines/template_url.cc
@@ -1217,7 +1217,8 @@ 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.
+ base::string16 keyword(net::StripWWW(net::IDNToUnicode(url.host(), "")));
Peter Kasting 2015/07/14 18:05:33 I think we should pass the user's accept-languages
alshabalin 2015/07/15 14:18:01 My thought was that a string in a language user do
Peter Kasting 2015/07/15 21:19:12 It seems like you're misunderstanding how the conv
alshabalin 2015/07/16 15:13:07 I thought script-mixing in hostnames is not allowe
alshabalin 2015/07/20 14:06:37 Done.
return keyword.empty() ? base::ASCIIToUTF16("www") : keyword;
}

Powered by Google App Engine
This is Rietveld 408576698