File: idn.py

package info (click to toggle)
python-getdns 1.0.0~b1-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 448 kB
  • sloc: ansic: 3,538; python: 607; makefile: 130
file content (20 lines) | stat: -rwxr-xr-x 489 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# coding=utf-8

import getdns, sys

try:
    ulabel = getdns.alabel_to_ulabel('xn--p1acf')
    # Next line contains a utf-8 string
    alabel = getdns.ulabel_to_alabel('рус')
    ulabel1 = getdns.alabel_to_ulabel('xn--vermgensberatung-pwb')
    # Next line contains a utf-8 string
    alabel1 = getdns.ulabel_to_alabel('vermögensberatung')
except getdns.error as e:
    print(str(e))
    sys.exit(1)

print (ulabel)
print (alabel)
print (ulabel1)
print (alabel1)