Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 1.6
-
Fix Version/s: 1.6
-
Component/s: Internationalisation, Technical infrastructure
-
Labels:None
Description
When tyring to geocode an address with french accents an error is generated.
" warning: simplexml_load_string() [function.simplexml-load-string]:
Entity: line 1: parser error : Input is not proper UTF-8 "
The error is in line Google.php line 107
$xml = simplexml_load_string( $string );
The can be fixed with a small function to remove accents.
A function to do this could be
function unaccent($text) {
static $search, $replace;
if (!$search) {
$search = $replace = array();
// Get the HTML entities table into an array
$trans = get_html_translation_table(HTML_ENTITIES);
// Go through the entity mappings one-by-one
foreach ($trans as $literal => $entity) {
// Make sure we don't process any other characters
// such as fractions, quotes etc:
if (ord($literal) >= 192)
}
}
return str_replace($search, $replace, $text);
}
and line 107 would now be
$xml = simplexml_load_string( unaccent($string) );