| Server IP : 66.29.153.156 / Your IP : 216.73.217.92 Web Server : LiteSpeed System : Linux premium322.web-hosting.com 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64 User : lastyfjz ( 1521) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /lib/python3.6/site-packages/rhn/ |
Upload File : |
#
# Connection objects
#
# Copyright (c) 2002--2020 Red Hat, Inc.
#
# Author: Mihai Ibanescu <misa@redhat.com>
from rhn import i18n
def idn_puny_to_unicode(hostname):
""" Convert Internationalized domain name from Punycode (RFC3492) to Unicode """
if hostname is None:
return None
else:
hostname = i18n.bstr(hostname)
return hostname.decode('idna')
def idn_ascii_to_puny(hostname):
""" Convert domain name to Punycode (RFC3492). Hostname can be instance of string or Unicode """
if hostname is None:
return None
else:
hostname = i18n.ustr(hostname)
return i18n.ustr(hostname.encode('idna'))