]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/unbound/libunbound/python/doc/examples/example7.rst
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / unbound / libunbound / python / doc / examples / example7.rst
1 .. _example_idna:
2
3 =================================================
4 Internationalized domain name support
5 =================================================
6
7 Unlike the libUnbound, pyUnbound is able to handle IDN queries.
8
9 ..      literalinclude:: example7-1.py
10         :language: python
11
12 If we use unicode string in :meth:`unbound.ub_ctx.resolve` method, the IDN DNAME conversion (if it is necessary) is performed on background.
13
14 ..      literalinclude:: example7-2.py
15         :language: python
16
17 The :class:`unbound.ub_data` class contains attributes suffix which converts the dname to UTF string. These attributes have the '_idn' suffix.
18 Apart from this aproach, two conversion functions exist (:func:`unbound.idn2dname` and :func:`unbound.dname2idn`).