This build can convert the German ligature ß into Punycode (in fact, this is the default). The change was required, since DeNIC, the registry for .de domains, now allows this character in domain names. A configuration option to enable the old behaviour is available.
This version adds the method encode_uri() to specifically convert the host name part of a whole URI to Punycode but leave the other components (path, query string, etc.) alone. The code has been cleaned up a little.