[Gdal-dev] shapefiles, attributes and non-ascii text

Frank Warmerdam fwarmerdam at gmail.com
Wed Jul 6 09:56:24 EDT 2005


On 7/6/05, Magnus Homann <magnus at homann.se> wrote:
> Hi,
> After readgin teh ESRI pages on shapefiles, it appears that somewhere in
> the shapefile there is a language driver ID. Is this read/written by ogr?

Magnus, 

Can you provide a more specific reference to this language flag? 
Is it in the shapefile header or the dbf file header?  Currently OGR
does *not* do anything special for this. 

> Is it possible to use unicode in the attributes set by
> OGRFeature::SetField()?

You could set unicode text in a string field, and it should transport
through the system, but there is nothing to tell the receiving
software what the encoding is. 

Hmm, looking at unicode a bit closer, I'm not so certain that
"unicode" string will have no zero-bytes in the string.  If you
encode your unicode text in UTF-8, then you would be fine.
If you encode it as UTF-16 then perhaps zero-page characters
would end up having zero-bytes which would be seen as a 
string end to the non-unicode aware OGR code. 

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list