Chromium Code Reviews| Index: components/search_engines/template_url_parser.cc |
| diff --git a/components/search_engines/template_url_parser.cc b/components/search_engines/template_url_parser.cc |
| index 51644b16d2b9e64578998a5fa5cc2528a3104caf..9f8d4aaa4a8a5d5f445d18262c431164a79b5daf 100644 |
| --- a/components/search_engines/template_url_parser.cc |
| +++ b/components/search_engines/template_url_parser.cc |
| @@ -6,6 +6,7 @@ |
| #include <algorithm> |
| #include <map> |
| +#include <string> |
| #include <vector> |
| #include "base/logging.h" |
| @@ -16,6 +17,7 @@ |
| #include "components/search_engines/template_url.h" |
| #include "libxml/parser.h" |
| #include "libxml/xmlwriter.h" |
| +#include "net/base/net_util.h" |
| #include "ui/gfx/favicon_size.h" |
| #include "url/gurl.h" |
| #include "url/url_constants.h" |
| @@ -251,7 +253,12 @@ void TemplateURLParsingContext::EndElementImpl(void* ctx, const xmlChar* name) { |
| context->ProcessURLParams(); |
| break; |
| case TemplateURLParsingContext::SHORT_NAME: |
| - context->data_.SetShortName(context->string_); |
| + // If someone gives us ShortName in punycode, decode it. |
| + context->data_.SetShortName( |
| + base::IsStringASCII(context->string_) |
|
Matt Giuca
2015/07/17 04:13:11
This should not be unpunycoded. The ShortName fiel
alshabalin
2015/07/20 14:06:38
Done.
|
| + ? net::IDNToUnicode(base::UTF16ToASCII(context->string_), |
| + std::string()) |
| + : context->string_); |
| break; |
| case TemplateURLParsingContext::IMAGE: { |
| GURL image_url(base::UTF16ToUTF8(context->string_)); |