Chromium Code Reviews| Index: components/url_formatter/elide_url.cc |
| diff --git a/components/url_formatter/elide_url.cc b/components/url_formatter/elide_url.cc |
| index bcc8840c83224827b048b0638632b6e214b47d08..399b44c2f0fea75d92fe3939e05d956c1d4e96f9 100644 |
| --- a/components/url_formatter/elide_url.cc |
| +++ b/components/url_formatter/elide_url.cc |
| @@ -78,15 +78,18 @@ void SplitHost(const GURL& url, |
| base::string16* url_host, |
| base::string16* url_domain, |
| base::string16* url_subdomain) { |
| - // Get Host. |
| - *url_host = base::UTF8ToUTF16(url.host()); |
| + // Get Host in ACE(ASCII Compatible Encoding). |
|
Peter Kasting
2016/04/06 21:38:39
Since we don't use "ACE" most other places in Chro
jungshik at Google
2016/04/06 21:50:38
Ok. (I regret not having used ACE before :-)).
|
| + std::string host_ace = url.host(); |
| // Get domain and registry information from the URL. |
| - *url_domain = |
| - base::UTF8ToUTF16(net::registry_controlled_domains::GetDomainAndRegistry( |
| - url, net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES)); |
| - if (url_domain->empty()) |
| - *url_domain = *url_host; |
| + std::string domain_ace = |
| + net::registry_controlled_domains::GetDomainAndRegistry( |
| + url, net::registry_controlled_domains::EXCLUDE_PRIVATE_REGISTRIES); |
| + if (domain_ace.empty()) |
| + domain_ace = host_ace; |
| + |
| + *url_host = url_formatter::IDNToUnicode(host_ace); |
| + *url_domain = url_formatter::IDNToUnicode(domain_ace); |
| // Add port if required. |
| if (!url.port().empty()) { |