[gdal-dev] Re: No support for widestrings in ArcSDE driver for OGR ?

Frank Warmerdam warmerdam at pobox.com
Mon Oct 27 16:32:50 EDT 2008


Ragi Y. Burhum wrote:
> On Mon, Oct 27, 2008 at 8:33 AM, <gdal-dev-request at lists.osgeo.org 
>     Hi all
> 
>     Throughout GDAL 1.5 and 1.6+ I havent been able to reading most
>     strings from ArcSDE using OGR, which is probably caused by the
>     ArcSDE drivers lack of widestring support (?). Is this correct, or
>     am I doing something wrong ? I'm pretty desperate for this to work
>     now. Seems as if a lot of ArcSDE data is stored as widestrings,
>     which seriously limits the applicability of my connection. Could
>     anyone give me an update on this ? I've tried looking at the tickets
>     but failed to find an entry that adressed this issue. Thanks,
> 
> 
>     Anders.
> 
> 
> Starting from 9.3 (or was it 9.2?) the strings created by ArcCatalog are 
> widestring by default. I took a quick look at ogrsdelayer.cpp and 
> ogrsdedatasource.cpp and that code is only consuming the non-Unicode API.
> 
> Frank: I did see that OGRSDELayer::Initialize(..) maps an OGR 
> OFTWideString (a type that the documentation says it is deprecated) to 
> an SDE widestring (i.e. SE_NSTRING_TYPE) if #SE_NSTRING_TYPE is defined, 
> however OGRSDELayer::TranslateSDERecord() does not have a case statement 
> for SE_NSTRING_TYPE (and therefore has no call to SE_stream_get_nstring 
> <http://edndoc.esri.com/arcsde/9.3/api/capi/schemaobjects/streams/strmgetnstring.htm>). 
> 
> 
> A quick fix to at least be able to consume the sde unicode strings would 
> be to add that case for that switch statement and take the result and 
> encode the UTF16 string to UTF8.
> 
> I would fix it myself and submit a patch, but ironically enough, I don't 
> have a way to test it or compile it since I don't have ArcSDE nor ArcGIS 
> anywhere... should I submit a ticket?

Ragi,

I'm in the same position - no SDE instance to test against.  A patch might
be good if either Howard or Anders are willing to commit to testing it out.

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