Google め
#!/usr/bin/perl use strict; use warnings; use utf8; use YAML; use Geo::Coder::Google; my $geocoder = Geo::Coder::Google->new( apikey => 'Your API Key' ); my $location = $geocoder->geocode( location => '国立国会図書館' ); binmode STDOUT, ':utf8'; print Dump $location;
↑だと↓で、
Content-Type: text/javascript; charset=UTF-8; charset=ISO-8859-1
--- AddressDetails: Accuracy: 1 Country: AddressLine: - ' ' CountryNameCode: JP Point: coordinates: - 139.744824 - 35.675871 - 0 address: ' ' id: p1
$geocoder->ua(LWP::UserAgent->new( agent => 'Mozilla/5.0' ));
↑すると↓。
Content-Type: text/javascript; charset=UTF-8; charset=UTF-8
--- AddressDetails: Accuracy: 1 Country: AddressLine: - 国立国会図書館国会分館 CountryNameCode: JP Point: coordinates: - 139.744824 - 35.675871 - 0 address: 日本国立国会図書館国会分館 id: p1
あいかわらず charset が2個あるのにはびっくりだ。