Since #2809789: UrlGenerator fails to urlencode aliases, incorrectly encodes "system" path $url->toString() always returns a string that is encoded using rawurlencode. This happens on line 300 in UrlGenerator.php
The returned string looks quiet ugly when it contains non-latin characters.
For example a url like:
/会社概要/イベントン
now looks like this:
/%E4%BC%9A%E7%A4%BE%E6%A6%82%E8%A6%81/%E3%82%A4%E3%83%99%E3%83%B3%E3%83%88%E3%83%B3
I'm not sure where the best place would be to change this behavior in core. But one place I've found that outputs the url as text is the LinkFormatter that sets the link title like this:
$link_title = $url->toString();
Changing the above to the following makes the link title look pretty again:
$link_title = rawurldecode($url->toString());
However I'm not sure if this is the right place to do it. If the above seems reasonable I'll upload a patch.
Comments
Comment #14
smustgrave commentedThank you for sharing your idea for improving Drupal.
We are working to decide if this proposal meets the Criteria for evaluating proposed changes. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or there is no community support. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #15
dcam commentedThis is a duplicate of #2904853: Use rawurldecode() in LinkFormatter to correctly display encoded URLs. The other issue is classified as a bug and some work on a fix has been performed. So I'm closing this one.
Comment #16
dcam commented