Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php): failed to open stream: No such file or directory in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24

Warning: include(): Failed opening '/home/blog66rr/public_html/wp-content/plugins/hyper-cache/cache.php' for inclusion (include_path='.:/opt/cpanel/ea-php70/root/usr/share/pear') in /home/blog66rr/public_html/wp-content/advanced-cache.php on line 24
什麼是Punycode? – unethost無限空間虛擬主機 技術分享部落格

什麼是Punycode?

最近收到客戶的請求,要我去幫客戶註冊一個中文域名。我想,這是什麼東西啊?客戶說,他要註冊的域名是像這樣子「印表機.com」這種的。後來,我研究了一下,才知道有一個專有名詞,叫做Punycode。在註冊中文域名之前,要先轉碼成Punycode,才能註冊。

查了一下網路上的資料,「什麼是Punycode?」

一般的域名在IIS或Apache中的虛擬主機設置,可以直接使用英文域名,例如 unethost.com。然而,現在逐漸開始流行的中文域名,如”網站設計.com”,在IIS或Apache中的伺服器設置檔應如何填寫呢?畢竟UTF-8編碼的中文,在apache或是IIS的設置檔通常是不容許的。

答案是:
在進行設置之前要先把中文域名轉化成為PunyCode編碼,然後在設置檔裡填上中文域名所對應的PunyCode編碼(xn--5tz61dz4phe.com)即可。新的國際化域名的標准在網域名稱編碼上,為了保留向下兼容性及不影響現有的應用程序協議,因此將多國語言域名轉成ASCII編碼,而這種編碼稱為『punycode』。

這邊有一個可以轉碼的連結