On Thu, 04 Jul 2013 13:38:09 +0300, Νίκος wrote: > So you are also suggesting that what gesthostbyaddr() returns is not > utf-8 encoded too?
The gethostbyaddr() OS function returns a byte string with no specified encoding. Python 3 will doubtless try to decode that to a character string using some (probably unspecified) encoding. Names obtained from DNS should consist entirely of ASCII characters (gethostbyname shouldn't attempt to decode internationalised names which use IDN, it should return the raw data). Names obtained by other means (e.g. /etc/hosts or Active Directory) could contain anything, but if you use non-ASCII hostnames you're asking for trouble. -- http://mail.python.org/mailman/listinfo/python-list