imajes/geokit-gem — Issue #43: Ruby 1.9.2p290 Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT
Author: jlsuttles
Created: 2012-01-27 23:03:24+00:00
State: open

irb: geocode = Geokit::Geocoders::GoogleGeocoder.geocode("29 Brooks Ave 90291")

===> Provider: google
Street: 29 Brooks Ave
City: Los Angeles
State: CA
Zip: 90291
Latitude: 33.9912303
Longitude: -118.4760829
Country: US
Success: true

irb: Geokit::Geocoders::GoogleGeocoder.geocode(geocode.full_address)

===> Provider: google
Street: 29 Brooks Ave
City: Los Angeles
State: CA
Zip: 90291
Latitude: 33.9912303
Longitude: -118.4760829
Country: US
Success: true

irb: geocode = Geokit::Geocoders::GoogleGeocoder.geocode("3961 Via Marisol 90042")

===> Provider: google
Street: 3961 Vía Marisol
City: Los Angeles
State: CA
Zip: 90042
Latitude: 34.0933459
Longitude: -118.186705
Country: US
Success: true

irb: Geokit::Geocoders::GoogleGeocoder.geocode(geocode.full_address)

Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT

irb: geocode.full_address.encoding

===> #

irb: ascii_address = geocode.full_address.force_encoding("ASCII-8BIT")

===> "3961 V\xC3\xADa Marisol, Los Angeles, CA 90042, USA"

irb: ascii_address.encoding

===> #

irb: Geokit::Geocoders::GoogleGeocoder.geocode(ascii_address)

Encoding::CompatibilityError: incompatible character encodings: UTF-8 and ASCII-8BIT