punycode

What is the maximum length of an IDNA converted domain name?

假如想象 提交于 2019-12-03 12:18:55
First things first: I'm storing multiple domains to a database, after I've converted each and every domain name to it's IDNA version. What I need to know the maximum length such an IDNA-converted domain name can have so I can define the database field's max length. Known fact: Now, I know the maximum number of characters in a domain name (including any subdomains) is 255 characters. Where I lost it: That's easy at first glance, but... does this mean regular ascii characters of international characters (think UTF-8 encoding)? To give you an example: The domain "müller.de" has 9 characters when

Punycode converter at C#

那年仲夏 提交于 2019-12-02 05:57:12
问题 I need a punycode converter for Silverlight. For WPF have such an opportunity in the standard libraries. I need a ready-made library or code of functions (punycode encoding and decoding) {C#, Silverlight}. 回答1: I am not sure if Silverlight has access to this namespace but take a look at these IdnMapping fuunctions which are built into the .net framework. 来源: https://stackoverflow.com/questions/5125566/punycode-converter-at-c-sharp

Nginx中文域名配置

自作多情 提交于 2019-11-29 11:59:16
Nginx虚拟主机上绑定一个带中文域名,比如linuxeye.中国,浏览器不能跳转。 why? 因为操作系统的核心都是英文组成,DNS服务器的解析也是由英文代码交换,所以DNS服务器上并不支持直接的中文域名解析,所有中文域名的解析都需要转成punycode码,然后由DNS解析punycode码。其实目前所说和各种浏览器完美支持中文域名,只是浏览器软里面主动加入了中文域名自动转码,不需要原来的再次安装中文域名转码控件来完成整个流程。 中文域名变为Punycode编码即可,在线转码地址: http://tools.jb51.net/punycode/ ,如下图: Punycode? Punycode是一个根据RFC 3492标准而制定的编码系统,主要用於把域名从地方语言所采用的Unicode编码转换成为可用於DNS系统的编码。 "中文域名"后缀不被标准的解析服务器支持,需转化为punycode码进行解析。 修改Nginx配置 server { listen 80; server_name blog.linuxeye.com linuxeye.xn--fiqs8s; ... } 保存,重载nginx: service nginx reload 来源: oschina 链接: https://my.oschina.net/u/2540666/blog/633216

Converting punycode with dash character to Unicode

风流意气都作罢 提交于 2019-11-26 09:23:54
问题 I need to convert the punycode NIATO-OTABD to nñiñatoñ . I found a text converter in JavaScript the other day, but the punycode conversion doesn\'t work if there\'s a dash in the middle. Any suggestion to fix the \"dash\" issue? 回答1: I took the time to create the punycode below. It it based on the C code in RFC 3492. To use it with domain names you have to remove/add xn-- from/to the input/output to/from decode/encode. The utf16-class is necessary to convert from JavaScripts internal