Opened 10 years ago

Closed 7 years ago

#4884 closed defect (wontfix)

Language I/O support for command line program on windows platform.

Reported by: miyukioki Owned by: warmerdam
Priority: normal Milestone:
Component: OGR_SF Version: svn-trunk
Severity: normal Keywords: multi language windows
Cc:

Description

I made patch for GDAL/ogr command line program on windows platform.

https://www.box.com/s/tqvek2gso065iq7lmo3c

ogr_lang.diff is patch for version 'gdal-2.0dev.'
https://svn.osgeo.org/gdal/trunk/gdal

This patch concept is 'using CP_ACP' for command line program. CP_ACP description was here.
http://msdn.microsoft.com/en-us/library/windows/desktop/dd374130(v=vs.85).aspx

First time, on windows platform, it's fine to run batch file with UTF-8. But argument charcter code chagned through. To understand this problem, see follow test code.
https://www.box.com/s/zi6ugdjcjrwf7h4ycj7c

Attachments (2)

ogr_lang.diff (4.3 KB ) - added by miyukioki 10 years ago.
patch file
utf8.bat (463 bytes ) - added by akaginch 10 years ago.
batch file using optfile option

Download all attachments as: .zip

Change History (9)

by miyukioki, 10 years ago

Attachment: ogr_lang.diff added

patch file

comment:1 by akaginch, 10 years ago

Is this a problem of reading file whose path includes non-ascii characters? If so, you can solve it by following statement.

SET GDAL_FILENAME_IS_UTF8=NO

Is there any other problem?

in reply to:  1 comment:2 by miyukioki, 10 years ago

Replying to akaginch:

Is this a problem of reading file whose path includes non-ascii characters? If so, you can solve it by following statement.

SET GDAL_FILENAME_IS_UTF8=NO

Is there any other problem?

No, any other problem. This patch is command line argument (I/O) for non-ascii characters.

eg. ogr2ogr -nln 日本語 ... ogr2ogr -nln 你好 ...

comment:3 by akaginch, 10 years ago

A batch file can do it. The advantage of this way is that it is not necessary to change existing codes (including output part).

utf8 ogr2ogr D:\東京都.shp D:\市町村界.shp -sql "SELECT * FROM '市町村界' WHERE Name LIKE '東京都%'" -lco "ENCODING=LDID/19"

in reply to:  3 comment:4 by miyukioki, 10 years ago

Replying to akaginch:

A batch file can do it. The advantage of this way is that it is not necessary to change existing codes (including output part).

utf8 ogr2ogr D:\東京都.shp D:\市町村界.shp -sql "SELECT * FROM '市町村界' WHERE Name LIKE '東京都%'" -lco "ENCODING=LDID/19"

Hi, Akaginchi san

Yes, I know. Did you read my post? This approach still has problem. Please check, follow code.

First time, on windows platform, it's fine to run batch file with UTF-8. But argument charcter >code chagned through. To understand this problem, see follow test code.

https://www.box.com/s/zi6ugdjcjrwf7h4ycj7c

comment:5 by akaginch, 10 years ago

The attached batch uses optfile option. Please try it.

by akaginch, 10 years ago

Attachment: utf8.bat added

batch file using optfile option

comment:6 by miyukioki, 10 years ago

Akaginch san, Thank you for pointing optfile.

Yes, now I completely understand. Option 'optfile' is best practice. This patch doesn't needed.

BTW, most people doesn't understand, how to avoid language problem. Document will be needed by this thema.

comment:7 by Jukka Rahkonen, 7 years ago

Resolution: wontfix
Status: newclosed

Author of the patch considers in the latest comment that an alternative suggestion to use a batch file + optfile option is better. Closing ticket as wontfix.

Note: See TracTickets for help on using tickets.