[gdal-dev] Usage of GDAL_FILENAME_IS_UTF8 config option

Poughon Victor Victor.Poughon at cnes.fr
Mon Jan 9 01:31:25 PST 2017


Hi,

We are using GDAL in OTB and recently we had a bug report about opening non
ASCII filenames on Windows 10 [0]. They suggest a fix using:

> CPLSetConfigOption("GDAL_FILENAME_IS_UTF8","NO");

The test case is GDALOpen() on a file named 你好.tif, which I confirmed works
fine on Linux, but not on Windows 7 or 10.

So my question is to have some clarification on this option, to know if it's
potentially the correct fix for this problem. The doc says:

> This effectively restores the pre-GDAL1.8 behavior for handling filenames on
> Windows and might be appropriate for applications that treat filenames as
> being in the local encoding.

What does it mean exactly to consider filenames to be in the local encoding? And
how do I know if my application [1] does that?

Cheers,

[0] https://github.com/orfeotoolbox/OTB/pull/14
[1] https://github.com/janestar/OTB/blob/f6ffdc17ab3d7aa91726f03ed619fee806eb508a/Modules/IO/IOGDAL/src/otbGDALDriverManagerWrapper.cxx#L55

Victor Poughon






More information about the gdal-dev mailing list