Skip Menu |

This queue is for tickets about the Yahoo-Search CPAN distribution.

Report information
The Basics
Id: 31618
Status: resolved
Priority: 0/
Queue: Yahoo-Search

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: geocode result has not utf8 flag set
It seems that Geo::Coder::Yahoo does not set the utf-8 flag: $ perl -MDevel::Peek -MGeo::Coder::Yahoo -e '$loc = Geo::Coder::Yahoo->new(appid => "test")->geocode(location => "Berlin, Dudenstr. 1"); Dump $loc->[0]->{address}' SV = PV(0x8e5bc8) at 0x985c18 REFCNT = 1 FLAGS = (POK,pPOK) PV = 0x9c96c0 "Dudenstra\303\237e 1"\0 CUR = 15 LEN = 16 The \303\237 is the german sharp s. Regards, Slaven
Subject: Re: [rt.cpan.org #31618] geocode result has not utf8 flag set
Date: Mon, 17 Dec 2007 16:39:55 -0800
To: bug-Geo-Coder-Yahoo [...] rt.cpan.org
From: Ask Bjørn Hansen <ask [...] perl.org>
On Dec 17, 2007, at 16:22, Slaven_Rezic via RT wrote: Show quoted text
> It seems that Geo::Coder::Yahoo does not set the utf-8 flag:
Patches welcome. :-) -- http://log.perl.org/ - http://askask.com/ - http://develooper.com/
On Mon Dec 17 19:40:20 2007, ask@perl.org wrote: Show quoted text
> > On Dec 17, 2007, at 16:22, Slaven_Rezic via RT wrote: >
> > It seems that Geo::Coder::Yahoo does not set the utf-8 flag:
> > > Patches welcome. :-) >
It seems that this should be handled by Yahoo::Search. I'll try to move the ticket. Regards, Slaven
(This ticket was originally in the Geo-Coder-Yahoo queue, but I think the problem needs to be solved in Yahoo::Search). The XML response sent back by the Yahoo API seems to miss the encoding attribute, so it is by default utf-8. Yahoo::Search::Parser fails to set the utf-8 flag on the result strings if there's a codepoint larger than 255. Tracing the TCP stream produced by Geo::Coder::Yahoo and Yahoo::Search, I swa the following request was sent: GET /MapsService/V1/geocode?appid=bbbike&location=Berlin%2C+%D6schelbronner+Weg+1 HTTP/1.1\r\n The XML result looked like this: <?xml version="1.0"?> ... <Address>\303\226schelbronner Weg 1</Address> ... So the result is clearly utf-8. It should also be noted that the query parameters are encoded as iso-8859-1, not utf-8, but I did not find a reference in Yahoo's documentation which encoding should be used here or how to flag a different encoding. Regards, Slaven
Fixed for next release. Thanks.