summaryrefslogtreecommitdiffstats
path: root/contrib/unbound/libunbound/python/doc/examples/example7.rst
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2013-04-05 09:43:20 +0000
committerdes <des@FreeBSD.org>2013-04-05 09:43:20 +0000
commitb0cbd784b12baa8ea27f7196e9a297847e8284c1 (patch)
tree6870f089d4472a1bab1bf9bb01ff61d3709c049f /contrib/unbound/libunbound/python/doc/examples/example7.rst
parent47b0933c6d1f9070043e74cfaaaab8a03ba2b47d (diff)
parent30c2432cb51cf03a3f4028c24488b364925a5d89 (diff)
downloadFreeBSD-src-b0cbd784b12baa8ea27f7196e9a297847e8284c1.zip
FreeBSD-src-b0cbd784b12baa8ea27f7196e9a297847e8284c1.tar.gz
Minimal subset of the unbound sources.
Diffstat (limited to 'contrib/unbound/libunbound/python/doc/examples/example7.rst')
-rw-r--r--contrib/unbound/libunbound/python/doc/examples/example7.rst18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/unbound/libunbound/python/doc/examples/example7.rst b/contrib/unbound/libunbound/python/doc/examples/example7.rst
new file mode 100644
index 0000000..d405021
--- /dev/null
+++ b/contrib/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`).
OpenPOWER on IntegriCloud