On Mon, Oct 27, 2008 at 8:33 AM,  <span dir="ltr">&lt;<a href="mailto:gdal-dev-request@lists.osgeo.org">gdal-dev-request@lists.osgeo.org</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
Message: 1<br>
Date: Mon, 27 Oct 2008 08:02:10 +0000<br>
From: Anders Moe &lt;<a href="mailto:anders.moe@geocap.no">anders.moe@geocap.no</a>&gt;<br>
Subject: [gdal-dev] No support for widestrings in ArcSDE driver for<br>
 &nbsp; &nbsp; &nbsp; &nbsp;OGR ?<br>
To: &lt;<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>&gt;<br>
Message-ID: &lt;BLU111-W60C7F1AFF2A5BEFECAE26FF2240@phx.gbl&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
<br>
Hi all<br>
<br>
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&#39;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&#39;ve tried looking at the tickets but failed to find an entry that adressed this issue. Thanks,<br>

<br>
<br>
Anders.<br>
</blockquote><div><br>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. <br>
<br>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 <a class="menulinks" target="_blank" href="http://edndoc.esri.com/arcsde/9.3/api/capi/schemaobjects/streams/strmgetnstring.htm">SE_stream_get_nstring</a>). <br>
<br>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.<br><br>I would fix it myself and submit a patch, but ironically enough, I don&#39;t have a way to test it or compile it since I don&#39;t have ArcSDE nor ArcGIS anywhere... should I submit a ticket?<br>
<br>Thanks,<br><br>- Ragi Yaser Burhum<br><br></div></div><br>