如何在bash中将IDN转换为Punycode?

Modified on: Sat, 12 Oct 2019 07:20:02 +0800

在bash中将IDN(例如президент.рф)转换为Punycode的最简单方法是什么?

最佳答案

查看idn

[U] net-dns/libidn
     Available versions:  1.22 (~)1.22-r1 {doc elibc_FreeBSD emacs java mono nls static-libs}
     Installed versions:  1.22(03:12:19 PM 07/04/2011)(nls static-libs -doc -elibc_FreeBSD -emacs -java -mono)
     Homepage:            http://www.gnu.org/software/libidn/
     Description:         Internationalized Domain Names (IDN) implementation

例如:

$ echo "президент.рф" | idn
xn--d1abbgf6aiiy.xn--p1ai
作者:quanta

相关问答

添加新评论