為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

HREF=UTF-8 String <a href="http://%E9%A3%9F....." doesn't work

  • 4 回覆
  • 2 有這個問題
  • 7 次檢視
  • 最近回覆由 guigs

more options

The problem that I have is IDN (International Domain Name) UTF-8 string set in the Web Page's < a href="

I have create the test case reside in the http://ecotw101.com/test_href_idn.html There are 2 lines in the page content 1st line: htef using the Chinese character input string and just like the type into the browser URL , both will works (connet to HTTP server) 2nd line: href using the UTF-8 3bytes encoding for each character and after it send to Apache Server, it get the following err message " Server not found

Firefox can't find the server at %e9%a3%9f%e7%89%a9%e5%85%8d%e8%b2%bb.%e6%85%88%e5%96%84%e7%b6%b2.net. "

The test case works fine with the Chrome browser.

Since the href content was generated from HTML editor or QR redirect program, it is UTF-8 format. Firefox use it for connect to Web Server and got error.

Don't know how Chrome handle the case. I guess that Chrome might do a convert from UTF-8 to PunyCode of IDN.

IE has the same problem. This problem will happen on the mobile smart phone after scan a QR code which use an IDN for redirecting the Web site.

Thanks !

- Mike


code edited to get rid of the whole paragraph worth of hyperlink - ed

The problem that I have is IDN (International Domain Name) UTF-8 string set in the Web Page's &lt; a href=" I have create the test case reside in the http://ecotw101.com/test_href_idn.html There are 2 lines in the page content 1st line: htef using the Chinese character input string and just like the type into the browser URL , both will works (connet to HTTP server) 2nd line: href using the UTF-8 3bytes encoding for each character and after it send to Apache Server, it get the following err message " Server not found Firefox can't find the server at %e9%a3%9f%e7%89%a9%e5%85%8d%e8%b2%bb.%e6%85%88%e5%96%84%e7%b6%b2.net. " The test case works fine with the Chrome browser. Since the href content was generated from HTML editor or QR redirect program, it is UTF-8 format. Firefox use it for connect to Web Server and got error. Don't know how Chrome handle the case. I guess that Chrome might do a convert from UTF-8 to PunyCode of IDN. IE has the same problem. This problem will happen on the mobile smart phone after scan a QR code which use an IDN for redirecting the Web site. Thanks ! - Mike ---------------------------- ''code edited to get rid of the whole paragraph worth of hyperlink - ed''

由 the-edmeister 於 修改

所有回覆 (4)

more options

network.standard-url.encode-utf8 = true (default: false) network.standard-url.escape-utf8 = false currently is true

If you change that second setting does it help? It did not for me but I saw back in version 3 this was a feature that was proposed fixed. https://bugzilla.mozilla.org/show_bug.cgi?id=552273 for reference. It I may ask is this the only site that does this?

more options

You can't have escaped cod in the first TLD part of the link. You can only have puny code in that part.

Note that the .net domain isn't whitelisted via a network.IDN.whitelist.net pref.

more options

Thanks for replying.

Have tried to set network.standard-url.escape-utf8 = false and restart the Firefox and it still can't solve the problem.

Chrome browser works fine.

I guess Firefox might need to convert the href=" %xx%xx ..." into the href="//xn--94qz02fu7 ...: punycode and then use the punycode to get name resolve.

- Mike

more options

Just to follow up: Bug 309671 was the actual bug, as one of the bugzilla contributors/engineers informed me. They are looking for help if you would like to read up on the discussion for this issue. Thank you for your time.