Github 页面无法与西里尔自定义域一起正常工作

Github Pages does not work properly with cyrillic custom domain

所以,我正在尝试在 github 页面上设置自定义域,但我的域包含西里尔字母,我无法添加自定义域:

但是英文字母都可以:

您需要遵循 IDNA 约定:

To prevent non-international domain names containing hyphens from being accidentally interpreted as Punycode, international domain name Punycode sequences have a so-called ASCII Compatible Encoding (ACE) prefix, "xn--", prepended.[2] Thus the domain name "bücher.tld" would be represented in ASCII as "xn--bcher-kva.tld".

使用 python 您可以尝试 encode('idna') 查找要使用的字符,例如:

$ python
>>> x = u'bücher.tld'
>>> x.encode('idna')
b'xn--bcher-kva.tld'
>>> x.encode('idna').decode('idna')
'bücher.tld'