Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 11-May-2018 | - | ||||
Makefile | H A D | 01-Feb-2017 | 214 | 15 | 10 | |
README | H A D | 01-Feb-2017 | 655 | 24 | 16 | |
idn.c | H A D | 01-Feb-2017 | 1.8 KiB | 82 | 66 | |
test.py | H A D | 01-Feb-2017 | 242 | 16 | 9 |
README
1*** Note that as of version 2.3 Python has native IDN support, see 2*** <http://www.python.org/doc/2.3.2/lib/module-encodings.idna.html>. 3 4This is a Python interface over Simon Josefsson's libidn 5<URL:http://josefsson.org/libidn/>. 6 7To install, be sure you have libidn installed, check the Makefile, and 8type "make" and "make install". 9 10Sample use: 11 12import idn 13print idn.idn2ace("Café"); # The string must be in UTF-8 14 15With a conversion to UTF-8 first, assuming your locale is Latin-1: 16 17import idn 18name = sys.argv[1] 19ustring = unicode(name, "Latin-1") 20print idn.idn2ace(ustring.encode("UTF-8")) 21 22------------------ 23Stephane Bortzmeyer <bortzmeyer@nic.fr> 24