in reply to Encoding Hell

Assuming the web server on the other end is properly configured, it will tell you which encoding to use in the HTTP headers. This may look like Content-Type: text/html; charset=utf-8 or some other variation thereof. If the charset value is specified, you can pass it on to Encode, and convert to the proper encoding.

Alternatively, you can sometimes find this indication in the <head> section of the html document. In that case, you should look for a line that looks like this: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />.

See Encode for details on converting between character sets. See HTTP::Response and HTTP::Header for access to the http headers.