[OpenLayers-Users] Issue with charactersets in GML

Nicholas Efremov-Kendall n.e.kendall at gmail.com
Wed Sep 30 13:14:05 EDT 2009


Hi all,
This is really a question outside of OpenLayers, but since OpenLayers is on
the client-side of things I think it's fair game.

I have an XML writer which is writing UTF-8 encoded data into an XML
attribute.

    $gml[] = '<ogr:SITE_>' . htmlentities($row['site_']) . '</ogr:SITE_>';
    $gml[] = '<ogr:LOCATION1>' . htmlentities($row['location1'], ENT_QUOTES,
'UTF-8') . '</ogr:LOCATION1>';
    $gml[] = '<ogr:PRESENCE_A>' . htmlentities($row['presence_a']) .
'</ogr:PRESENCE_A>';
    $gml[] = '<ogr:MATERIAL>' . htmlentities($row['material']) .
'</ogr:MATERIAL>';
    $gml[] = '<ogr:NEWSITE_>' . htmlentities($row['newsite_']) .
'</ogr:NEWSITE_>'

the issue at hand is with the second line. When I leave out ENT_QUOTES,
'UTF-8', my search only returns one site. And when I comment out the line
altogether, the application works fine, just one of my attributes returns
"undefined" in my popups. When I leave that in, it only returns a select few
of my POI's. The characterset in the UTF-8 table is transliterated arabic. I
have the mysql_set_charset() function set on the database connection, and
there's no problem echoing the characters into a table accompanying the
application. Also, for the sites that are returned, the data is properly
rendered in the popups.

What I think is happening is that the XML writer at some stage is tripping
up because of the special characters, although they're rendered properly
when they come through. Has anyone had any experiences similar to this? Yes,
the XML is UFT-8 encoded. I'm willing to share all my code, but there's too
much of it to bludgeon people with here.
-- 
Nicholas Efremov-Kendall
Fulbright Student 2009-2010, Ukraine
nefremov at artsci.wustl.edu
c/o Halyna Yerko
Balzaka 92a, Kv 27
02232
Kyiv, Ukraine
(mob) +380963576524
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090930/78eb863c/attachment.html


More information about the Users mailing list