#7142 closed defect (fixed)
ogr2ogr Windows command line encoding of special characters issue
Reported by: | hansw | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | default | Version: | svn-trunk |
Severity: | normal | Keywords: | character encoding attributes windows command line |
Cc: |
Description
Hello,
I'm using GDAL 2.3.0dev, (compiled: November 08 2017) under Windows 7 x64. Source
I'm trying to rename an attribute to an attribute name with a special character (umlaut). This Character is part of the ANSI character encoding.
This is the windows batch command I tried. (test.sqlite is attached to the ticket)
CMD /c ogr2ogr.exe -f "GPKG" "C:\result.gpkg" "C:\test.sqlite" -sql "SELECT \"ogc_fid\", \"test\", \"laenge\" AS \"länge\", \"geometry\" FROM \"test\";"
It works fine except that it does not rename the attribute correctly. The result can be seen in the first attached picture (result.png). The expected result can be seen in the second attached picture (expected_result.png).
So I tried to set the windows command to Unicode (UCS-2 le) with the "/U" option (see).
CMD /U /c ogr2ogr.exe -f "GPKG" "C:\result.gpkg" "C:\test.sqlite" -sql "SELECT \"ogc_fid\", \"test\", \"laenge\" AS \"länge\", \"geometry\" FROM \"test\";"
This did not work either. So I tried an easy test case:
CMD /c Echo This is a test öäüßÖÄÜ > "C:\test.txt"
This does give me a text file with the expected text:
This is a test öäüßÖÄÜ
As this tells me that encoding of this special characters works fine on my system. I would like to ask if that could be a GDAL Windows issue. And if possible if it can be fixed.
Another related issue could be the Ticket 6447.
Attachments (3)
Change History (5)
by , 6 years ago
Attachment: | test.sqlite added |
---|
comment:1 by , 6 years ago
Milestone: | 2.3.0 |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Yes this is a general issue with command line utilities on Windows and non-ASCII characters. GDAL utilities should probably use the Unicode Windows API to get the command line values
Closing as duplicate of #7065
test file