From 9ef094b356b4da7542c3cab898dac7e135b76903 Mon Sep 17 00:00:00 2001 From: Riccardo Spagni Date: Sun, 5 Oct 2014 23:44:31 +0200 Subject: added unbound to external deps --- .../libunbound/python/doc/examples/example7.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 external/unbound/libunbound/python/doc/examples/example7.rst (limited to 'external/unbound/libunbound/python/doc/examples/example7.rst') diff --git a/external/unbound/libunbound/python/doc/examples/example7.rst b/external/unbound/libunbound/python/doc/examples/example7.rst new file mode 100644 index 000000000..d4050215e --- /dev/null +++ b/external/unbound/libunbound/python/doc/examples/example7.rst @@ -0,0 +1,18 @@ +.. _example_idna: + +================================================= +Internationalized domain name support +================================================= + +Unlike the libUnbound, pyUnbound is able to handle IDN queries. + +.. literalinclude:: example7-1.py + :language: python + +If we use unicode string in :meth:`unbound.ub_ctx.resolve` method, the IDN DNAME conversion (if it is necessary) is performed on background. + +.. literalinclude:: example7-2.py + :language: python + +The :class:`unbound.ub_data` class contains attributes suffix which converts the dname to UTF string. These attributes have the '_idn' suffix. +Apart from this aproach, two conversion functions exist (:func:`unbound.idn2dname` and :func:`unbound.dname2idn`). -- cgit v1.2.3