2011-03-16 28 views
5

是否可以在子域中使用UTF-8?如果是這樣,允許哪些字符,以及不可混合編碼的東西如何工作?Utf-8在子域?

我試着RTFM,但谷歌wan't的多help

回答

2

沒有特別的子域很多事情。給定的域名foo.example.com是標籤的有序列表(foo,example,com)。所以你可能想知道你是否可以在給定的標籤中使用UTF-8。

低水平的答案是,一個標籤定義爲:

<label> ::= <letter> [ [ <ldh-str> ] <let-dig> ] 
<let-dig> ::= <letter> | <digit> 
<letter> ::= any one of the 52 alphabetic characters A through Z in upper case and a through z in lower case 
<digit> ::= any one of the ten digits 0 through 9 
<ldh-str> ::= <let-dig-hyp> | <let-dig-hyp> <ldh-str> 
<let-dig-hyp> ::= <let-dig> | "-" 

偉馳意味着你只能找到一個標籤[-a-zA-Z0-9]

Howecer,IDNA用於編碼Unicode字符,簡而言之,包含其他字符的標籤編碼爲:"xn--" + punycode(nameprep(label))

至於至少限制:

  • 爲字符不能在一個IDN標籤(U + 002E,U + 3002,U + FF0E,U + FF61)。
+1

只有鏈接的答案在一般情況下是不好的(我也碰巧無法找到與* subdomains *的實際問題有很大關係) – Jasper 2015-04-01 14:57:54