FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=17876&edit=1

ID: 17876
Updated by: izi@php.net
Reported By: ahto at on-line dot fi
Summary: encoding issues with input already utf8
-Status: Open
+Status: Closed
Type: Bug
Package: Services_GeoNames
Operating System: Ubuntu 10.04
Package Version: 1.0.0
PHP Version: 5.3.2
-Assigned To:
+Assigned To: izi
Roadmap Versions:
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: izi
This bug has been fixed in SVN.

If this was a documentation problem, the fix will appear on pear.php.net
by the end of next Sunday (CET).

If this was a problem with the pear.php.net website, the change should
be live shortly.

Otherwise, the fix will appear in the package's next release.

Thank you for the report and for helping us make PEAR better.

Fixed now, thanks for the report Ahto.


Previous Comments:
------------------------------------------------------------------------

[2010-09-20 16:51:45] ahto

Description:
------------
In function formatQueryString in file GeoNames.php there are two lines
which inlude this "urlencode(utf8_encode(".

When the input that is passed to the script is already encoded in utf-8.
this makes the non ascii characters blow up.

Test script:
---------------
<?php
require_once 'Services/GeoNames.php';
class testgeo extends Services_GeoNames{
public function formatQueryString($params = array())
{
$qString = array();
foreach ($params as $name => $value) {
if (is_array($value)) {
foreach ($value as $val) {
$qString[] = $name . '=' .
urlencode(utf8_encode($val));
}
} else {
$qString[] = $name . '=' .
urlencode(utf8_encode($value));
}
}
return implode('&', $qString);
}
}
$geo = new testgeo();
echo urldecode($geo->formatQueryString(array('name_equals' =>
'mänttä')));

Expected result:
----------------
name_equals=mänttä

Actual result:
--------------
name_equals=mänttä

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedOct 1, '10 at 10:55a
activeOct 1, '10 at 10:55a
posts1
users1
websitepear.php.net

1 user in discussion

Izi: 1 post

People

Translate

site design / logo © 2022 Grokbase