imajes/geokit — pull request #67 by greglazarev (2012-07-02 05:39:55+00:00)
Title: ipgecoder handles non-utf8 character sets; fixed tests

In the ipgeocoder the provider hostip.info sometimes returns responses that are encoded in Latin-1, however Ruby thinks it's UTF-8. This is incompatible with Rails 3 (and others?) and will error in psych yaml library.

To reproduce this, simply try to geocode ip of 201.23.177.144
This was tested in ruby 1.9.3-p194

This pull request looks at the headers and forces the right encoding, then encodes it to UTF-8. I've wrote tests for this case. Also I fixed other tests that were failing.