diff --git a/lib/geocoder/lookups/maxmind.rb b/lib/geocoder/lookups/maxmind.rb index 2ecb4c6652c2f79e30796759bbfec51762c7ffc0..631c4764d3073546451a6e4f8684e13fe1b427dc 100644 --- a/lib/geocoder/lookups/maxmind.rb +++ b/lib/geocoder/lookups/maxmind.rb @@ -71,7 +71,9 @@ module Geocoder::Lookup end def parse_raw_data(raw_data) - CSV.parse_line raw_data + # Maxmind just returns text/plain as csv format but according to documentation, + # we get ISO-8859-1 encoded string. We need to convert it. + CSV.parse_line raw_data.force_encoding("ISO-8859-1").encode("UTF-8") end def reserved_result