更新时间:2023-01-31 09:18:41
我写了一篇有关 Internet Explorer不显示解码版本的非ASCII字符并使用IRI 解决问题。
截至今天,我们有以下情况:
href
属性中的 IRIs ,并将其正确显示在它的地址栏就像手动输入你的URL(键盘; - ))所以你可以尝试以下内容:
< a href =http://zh.wikipedia.org/wiki/亦思巴奚兵>亦思巴奚兵乱< / a>
可以在W3C上找到一篇关于该主题的精彩文章:多语言网址简介。
I am working on a requirement to display (make readable) characters from the URL.
When I use Google Chrome, it displays the parameters in Chinese - even though they are encoded to UTF-8.
When I use Mozilla Firefox, it displays the parameters in Chinese - even though they are encoded to UTF-8.
When I use Internet Explorer, it displays the parameters encoded in UTF-8.
N.B. The URL is encoded to UTF-8; I know that because when I copy the URL from the three of them and paste it to Notepad++ the three of them display the following:
/%E6%89%93%E5%BC%80%E7%9B%AE%E5%BD%95/%E7%9B%B8%E6%9C%BA/%E6%95%B0%E7%A0%81%E7%9B%B8%E6%9C%BA/%E5%B0%8F%E5%9E%8B%E6%95%B0%E7%A0%81%E7%9B%B8%E6%9C%BA/PowerShot-A480/p/1934793
Could it be that Mozilla Firefox and Google Chrome guys have this improvement that can make an encoded String readable and perhaps the IE guys do not support that? Or, is there any way to activate that with IE?
By the way... Going to View >> Encoding >> Unicode (UTF-8) takes care of the text inside of the page but does not make any difference for the text in the URL.
Any help will be greatly appreciated!
I've written a blog post about Internet Explorer not displaying the decoded version of non-ASCII characters and using IRIs to solve the problem.
As of today, we have the following situation:
href
attribute of anchor tags and properly displays them in its address bar just like when you enter your URL by hand (keyboard ;-)).So you could try the following:
<a href="http://zh.wikipedia.org/wiki/亦思巴奚兵乱">亦思巴奚兵乱</a>
A great article on the topic can also be found at the W3C: An Introduction to Multilingual Web Addresses.