When I make this HTTP request:
Net::HTTP.get_response('www.telize.com',"/geoip/190.88.39.27").body
=> "{\"timezone\":\"America\\/Curacao\",\"isp\":\"United Telecommunication Services (UTS)\",\"country\":\"Cura\xE7ao\",\"dma_code\":\"0\",\"region_code\":\"00\",\"area_code\":\"0\",\"ip\":\"190.88.39.27\",\"asn\":\"AS11081\",\"continent_code\":\"NA\",\"city\":\"Willemstad\",\"longitude\":-68.9167,\"latitude\":12.1,\"country_code\":\"CW\",\"country_code3\":\"CUW\"}\n"
It returns a JSON body, but notice the country: \"country\":\"Cura\xE7ao\". The response body should actually looks like this: "country":"Curaçao". It looks like Net::HTTP is assuming this is ASCII-8BIT:
Net::HTTP.get_response('www.telize.com',"/geoip/190.88.39.27").body.encoding
=> Encoding:ASCII-8BIT
but this can't be the case. How can I tell Net::HTTP which character encoding to use when making the request?