Skip Menu |

This queue is for tickets about the Geo-Coder-Cloudmade CPAN distribution.

Report information
The Basics
Id: 73480
Status: resolved
Priority: 0/
Queue: Geo-Coder-Cloudmade

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

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



Subject: Encode::is_utf8 check possibly wrong
The geocode method has the following lines: if( Encode::is_utf8($location) ) { $location = Encode::encode_utf8($location); }; Checking here for the utf8 flag (Encode::is_utf8(...)) is wrong — you want to get utf8 octets here even if the string is coded in latin1, without a utf8 flag. So the if condition may be safely removed. (This of course means that the users have to declare their data correctly if using utf8, i.e. source code must have the "use utf8" pragma, and data from files should have been processed through the utf8 encoding layer) Regards, Slaven
This is fixed in the 0.3 release - apologies for the looong delay :(. On Sun Dec 25 15:53:41 2011, SREZIC wrote: Show quoted text
> The geocode method has the following lines: > > if( Encode::is_utf8($location) ) { > $location = Encode::encode_utf8($location); > }; > > Checking here for the utf8 flag (Encode::is_utf8(...)) is wrong — you > want to get utf8 octets here even if the string is coded in latin1, > without a utf8 flag. So the if condition may be safely removed. (This of > course means that the users have to declare their data correctly if > using utf8, i.e. source code must have the "use utf8" pragma, and data > from files should have been processed through the utf8 encoding layer) > > Regards, > Slaven