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..5455f82a77529fa71927d4becb3f73d6385c74e3 100644 |
| --- a/components/search_engines/template_url_parser.cc |
| +++ b/components/search_engines/template_url_parser.cc |
| @@ -16,6 +16,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 +252,11 @@ 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_) |
|
Peter Kasting
2015/07/14 18:05:33
Why do an ASCII check here? Why not just uncondit
alshabalin
2015/07/15 14:18:01
IDNToUnicode requires ASCII because it calls ASCII
Peter Kasting
2015/07/15 21:19:12
At the least you need a comment in all these place
|
| + ? net::IDNToUnicode(base::UTF16ToASCII(context->string_), "") |
| + : context->string_); |
| break; |
| case TemplateURLParsingContext::IMAGE: { |
| GURL image_url(base::UTF16ToUTF8(context->string_)); |