repo.or.cz
/
libidn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
*** empty log message ***
[libidn.git]
/
contrib
/
idn-python
/
test.py
blob
2cb80c2fe9ab00b15b1fa38c6206b6e24c454178
1
#!/usr/bin/python
2
3
# $Id$
4
5
locale
=
"Latin-1"
6
7
import
idn
8
import
sys
9
10
if
len
(
sys
.
argv
) <=
1
:
11
print
"Usage:
%s
name"
%
sys
.
argv
[
0
]
12
sys
.
exit
(
1
)
13
14
name
=
sys
.
argv
[
1
]
15
16
ustring
=
unicode
(
name
,
locale
)
17
print
idn
.
idn2ace
(
ustring
.
encode
(
"UTF-8"
))