Simple net/http request encoding


Just simple example with net/http.

url = URI.parse(‘’)
req =
res = Net::HTTP.start(, url.port) {|http|
p res.body

Gives me ? ? ? ? on some danish characters.

I have no idea how to get the right encoding with net/http library?

Any ideas?

Thanks for any help.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs