aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Geocode.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-22 15:26:51 +0000
committerMatthew Somerville <matthew@fury.ukcod.org.uk>2011-02-22 15:26:51 +0000
commite3c8c5d194a7a7dce70152f89c65616c8981c1a3 (patch)
tree281183e4345f8d9a400c4b651140f4055635a375 /perllib/FixMyStreet/Geocode.pm
parent3c97d45cb1a3803e74c43ef3eca3beb4a5d3ed23 (diff)
Couple of URI escaping fixes, plus cope with different versions of LWP returning content/decoded_content.
Diffstat (limited to 'perllib/FixMyStreet/Geocode.pm')
-rw-r--r--perllib/FixMyStreet/Geocode.pm1
1 files changed, 1 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 17a4d8539..803e32a85 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -106,6 +106,7 @@ sub string {
|| mySociety::Config::get('COUNTRY') ne 'GB';
$url .= '&sensor=false&key=' . mySociety::Config::get('GOOGLE_MAPS_API_KEY');
$js = LWP::Simple::get($url);
+ $js = encode_utf8($js) if utf8::is_utf8($js);
File::Path::mkpath($cache_dir);
File::Slurp::write_file($cache_file, $js) if $js && $js !~ /"code":6[12]0/;
}