I have a function that takes a string as an input parameter. This function then urlencodes the string and sends it to a server with telnetlib.Telnet The problem is that the string gets converted into what seems to be Unicode. How can I check to see if the input-string is Unicode and convert it to a different character set (in this case ISO-Latin1).