Simple net/http request encoding

Hello,

Just simple example with net/http.

url = URI.parse(‘http://www.bt.dk’)
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|
http.request(req)}
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