[mapserver-users] Connectiontype OGR with shapefile encoding

Hawk AA hawk at aamdal.com
Mon Nov 5 06:40:20 PST 2012


Hi,

 

You’ve probably had it with encoding issues, but I can’t seem to figure it
out. I sure hope the Mailing List can help me with this one.

 

I have a shapefile encoded in latin1 . Until recently I have been able to
use CONNECTIONTYPE OGR to access that table like this:

 

CONNECTIONTYPE OGR

CONNECTION "TM_Nett/TM_Traces.shp"

 

You are probably wondering why I’m not using the DATA keyword instead of
these lines, and that would indeed solve the encoding problem (I’ve tried).
The reason why I use OGR is that I need a FILTER applied to the given layer,
and to hide data from the WFS service, using OGR seemed like a nice
workaround (I’ve recently sent an email regarding this issue).

 

The problem started when I upgraded to PHP 5.4, replacing multiple DLLs in
the cgi-bin directory of my MS4W installation. The OGR will now only return
me attributes encoded in UTF-8 (I can see no other possibility that it
converts the data from latin1 to UTF-8). The UTF-8 attributes are not
compatible with the rest of the layers, which returns latin1 (using DATA).


Anyone have got a clue of where the problem might be? Is it that the
original shapefile have some wrong headers causing the OGR driver to do a
conversion (I’ve tried saving the shapefile as both Latin1 and UTF-8 in QGIS
with no luck)? Is it possible to tell the OGR driver what encoding to use?

 

Best Regards,

Håkon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121105/91268ae1/attachment.html>


More information about the mapserver-users mailing list