fix #39: detect charset and force encoding

If the API response specifies a character encoding then force the encoding of the returned string to use the same encoding.