I'm developing a GE API application for worldwide users but only using
Latin1_Swedish placenames, often with acutes, graves, circumflexes
etc.
My placenames are in a MySql table and I use php to create kml files
for the GE plugin.
I'm fairly certain that these accents were displayed OK in the name
tags in the kml files, although for weeks I have had the names turned
off. Ceratinly there were no parse problems and I imagine that I had
plenty of accents in my data.
Today I have "turned on" the names again and GE reports a parse error
when a placename includes accents.
The XML specifies:
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
The MySql place table and name column had collation of
latin1_swedish_ci
After browsing forums I:
- Created a temp column with collation = utf8_unicode_ci
- Copied the name data to the temp column
- Changed the name column's collation from latin1_swedish_ci to =
utf8_unicode_ci
- Copied the name data back to the name column
but nothing improved. I also tried utf8_unicode_ci without success.
https://www.zend.com/en/forums/index.php?t=msg&goto=10510&S=d25345f77...
suggests that I have to specify utf-8 when connecting ie like this:
$set_connection_encodings = array(
'character_set_client=utf8'
,'character_set_connection=utf8'
,'character_set_results=utf8'
,'collation_connection=utf8_general_ci'
,'collation_database=utf8_general_ci'
);
foreach( $set_connection_encodings AS $set_connection_encoding )
{
$sql = 'SET ' . $set_connection_encoding;
mysql_query( $sql );
}
But I also see that the recent issue 307 concerns special characters
in name tags, so I wonder if someone could please confirm whether I
need issue 307 to be resolved rather than trying to complicate my
connection code ?
Thanks. Mike