
Was ist der einfachste Weg, eine IDN (wie etwa президент.рф) in Bash in Punycode zu konvertieren?
Antwort1
Schauen Sie sich dieidn
:
[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
Zum Beispiel:
$ echo "президент.рф" | idn
xn--d1abbgf6aiiy.xn--p1ai
Antwort2
Vorausgesetzt, Sie haben Python auf Ihrem System, python -c 'import sys;print sys.argv[1].decode("utf-8").encode("idna")' "президент.рф"
würde das funktionieren.
Antwort3
Unter MacOS brew install homebrew/versions/libidn2
.
Dann echo "президент.рф" | idn2
.