[gdal-dev] UTF-8 problem with MSSQLSpatial and ogr2ogr

Chaitanya kumar CH chaitanya.ch at gmail.com
Fri Mar 30 03:56:54 EDT 2012


Phillippe,

You can start with http://trac.osgeo.org/gdal/wiki/BuildHints if you want
to do this yourselves.
You can file a ticket at http://trac.osgeo.org/osgeo/newticket and attach
your patch there.

Also, provide a link to the MSSQL documentation regarding this.

Thank you.

On Fri, Mar 30, 2012 at 12:14 PM, philippe.suray <
philippe.suray at market-ip.com> wrote:

> Hello,
>
> I am trying to load a shape file encoded in UTF-8 in SQLServer2008.
> I use this command from ogr2ogr to load the data's:
>
> ogr2ogr --debug on -f MSSQLSpatial
> "MSSQL:server=localhost;database=ogr2ogrTest;Trusted_Connection=True;"
> "myShapeFile.shp" -t_srs EPSG:4326 -dsco ENCODING=UTF-8 -lco ENCODING=UTF-8
> -overwrite -progress
>
> When I check the records in the DB, some fields are not correctly encoded.
>
> According to SQLServer documentation and to my understanding: in order to
> store unicode, the fields must be declared as NCHAR or NVARCHAR and the
> insert or update statements must append 'N' before the value (INSERT INTO
> tForeignLanguage ([Name]) VALUES (N'Араб'))
>
> I also search about unicode in this list and found:
> - http://osgeo-org.1560.n6.nabble.com/RFC-23-OGR-Unicode-td3759338.html
> - http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode
>
> I downloaded the latest source code from http://www.gdal.org/daily/ and
> check into mssqlspatial component and found that the driver does not
> respect
> these assumptions:
> - fields are created as VARCHAR,
> - statements does not append 'N'
>
> I really need this unicode support but I am not very familiar with C++,
> could you help me to implement a patch to test the loading of a shapefile
> into SQLServer2008.
> What classes should I change and how?
>
> Thank you for your help.
>
> Best regards.
>
> Philippe
>
> --
> View this message in context:
> http://osgeo-org.1560.n6.nabble.com/UTF-8-problem-with-MSSQLSpatial-and-ogr2ogr-tp4670214p4670214.html
> Sent from the GDAL - Dev mailing list archive at Nabble.com.
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>



-- 
Best regards,
Chaitanya kumar CH.

+91-9494447584
17.2416N 80.1426E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/gdal-dev/attachments/20120330/c27cf304/attachment.html


More information about the gdal-dev mailing list