Even,<br><br>I think I've figured this out, in my particular example I had a filename which contained the character 'é' (U+00E9), which in UTF-8 encoding is the two byte sequence 0xC3 0xA9. However, this character is also in the ANSI character set (233 decimal), which explains why passing a "normal" ANSI encoded C String to GDALOpen will open the file. If we instead try a filename with a character that is not in the ANSI character set, for example 'ə' (U+0259), then the function will not work (even) with a normal C String.<br>
<br>So the current Win32 C/C++ API does not support UTF-8 encoded strings. Are you aware of any workarounds that may be available?<br><br>Best Regards,<br>Louis.<br><br> <br><div class="gmail_quote">On Mon, Aug 31, 2009 at 7:19 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@mines-paris.org">even.rouault@mines-paris.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Louis, Chaintanya,<br>
<br>
I just wanted to mention that the topic of encoding for filenames dealt by GDAL<br>
or OGR is a known issue that has not been addressed yet. You can read<br>
<a href="http://trac.osgeo.org/gdal/wiki/rfc5_unicode" target="_blank">http://trac.osgeo.org/gdal/wiki/rfc5_unicode</a> which was a proposal but has not<br>
been implemented. Some infrastructure for re-encoding has been introduced during<br>
the implementation of <a href="http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode" target="_blank">http://trac.osgeo.org/gdal/wiki/rfc23_ogr_unicode</a> (but<br>
RFC23 only addresses the issue of encoding in OGR field values, not for<br>
filenames)<br>
<br>
My understanding is that :<br>
* on Windows the current API used by GDAL/OGR does not expect UTF8 or Unicode<br>
but ANSI.<br>
* on Linux systems, UTF-8 is now assumed<br>
<br>
Best regards,<br>
<br>
Even<br>
<br>
Selon Lodewijk Pool <<a href="mailto:louis.pool@gmail.com">louis.pool@gmail.com</a>>:<br>
<div><div></div><div class="h5"><br>
> Hi Chaitanya,<br>
><br>
> I appreciate you taking the time to check. The TAB extension is MapInfo's<br>
> vector file format. The odd thing is that I did exactly the same test as you<br>
> did, I renamed a GeoTiff file to the offending filename and tried the normal<br>
> Raster Driver and got the same problem. Still, as far as you aware these<br>
> functions should support UTF-8 encoded strings? There could possibly be a<br>
> peculiarity in the way I pack UTF-8 strings, though I am reasonably certain<br>
> that they are encoded correctly.<br>
><br>
> Could you perhaps send me the code snippet you used to test the<br>
> functionality (the part where you pass the string to GDALOpen). Do you think<br>
> there is a chance that my compiled version may differ from your own, i.e. is<br>
> it possible that I compiled a version of GDAL without UTF support?<br>
><br>
> Best Regards,<br>
> Louis.<br>
><br>
> On Mon, Aug 31, 2009 at 6:35 PM, Chaitanya kumar CH<br>
> <<a href="http://chaitanya.ch" target="_blank">chaitanya.ch</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>>wrote:<br>
><br>
> > Louis,<br>
> ><br>
> > I couldn't reproduce the problem on my WinXP-32 system with vc8 with locale<br>
> > set to uk english. However, I used the filename on a GeoTiff file. I<br>
> > couldn't identify the .TAB extension. I am not sure that is a problem.<br>
> ><br>
> > Some of the drivers may not handle non-ascii data but file names should not<br>
> > be a problem.<br>
> ><br>
> > If you don't find any problem at your application side, submit a bug report<br>
> > at <a href="http://trac.osgeo.org/gdal/" target="_blank">http://trac.osgeo.org/gdal/</a><br>
> ><br>
> ><br>
> > On Mon, Aug 31, 2009 at 8:02 PM, Lodewijk Pool <<a href="mailto:louis.pool@gmail.com">louis.pool@gmail.com</a>>wrote:<br>
> ><br>
> >> Hi Chaitanya,<br>
> >><br>
> >> Yes, this is using the C/C++ API, the functions I am using are declared in<br>
> >> *gdal.h* and *ogrsf_frmts.h* respectively. I am using WinXP 32bit (UK<br>
> >> English locale) and a version of GDAL 1.6.2 that I compiled for Win32<br>
> using<br>
> >> the supplied nmake script files for VC8. The specific filename that is<br>
> >> causing me problems is this one; *"découpage_geographique.TAB"*. If I<br>
> >> remove the 'é' character in that string and replace it with a normal 'e'<br>
> the<br>
> >> file opens without any problems.<br>
> >><br>
> >> Any help would be appreciated.<br>
> >><br>
> >> Best Regards,<br>
> >> Louis.<br>
> >><br>
> >><br>
> >><br>
> >><br>
> >><br>
> >> On Mon, Aug 31, 2009 at 4:10 PM, Chaitanya kumar CH <<a href="http://chaitanya.ch" target="_blank">chaitanya.ch</a>@<br>
> >> <a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
> >><br>
> >>> Louis,<br>
> >>><br>
> >>> GDAL/OGR usually supports utf-8 encoding. I just don't know where it<br>
> >>> doesn't support.<br>
> >>> Can you provide the details of the OS you are working on? Also, some<br>
> >>> sample file names that caused you problems will come handy.<br>
> >>> I presume you are working in C/C++.<br>
> >>><br>
> >>> On Mon, Aug 31, 2009 at 6:37 PM, Lodewijk Pool<br>
> <<a href="mailto:louis.pool@gmail.com">louis.pool@gmail.com</a>>wrote:<br>
> >>><br>
> >>>> Hi All,<br>
> >>>><br>
> >>>> I'm having problems opening Raster and Vector Datasources that have<br>
> >>>> filenames and paths with special characters. I'm using GDALOpen for<br>
> Raster<br>
> >>>> sources and OGRSFDriverRegistrar::Open() for Vector sources, the strings<br>
> I<br>
> >>>> pass for the filenames are UTF-8 encoded. Does anyone know whether these<br>
> >>>> functions support UTF-8 encoding, and if not, whether there are any<br>
> other<br>
> >>>> API entry points that do support UTF-8 and/or UTF-16?<br>
> >>>><br>
> >>>> Thank you in advance,<br>
> >>>> Louis.<br>
> >>>><br>
> >>>> _______________________________________________<br>
> >>>> gdal-dev mailing list<br>
> >>>> <a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
> >>>> <a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
> >>>><br>
> >>><br>
> >>><br>
> >>><br>
> >>> Best regards,<br>
> >>> --<br>
> >>> Chaitanya kumar CH.<br>
> >>><br>
> >><br>
> >><br>
> ><br>
> ><br>
> > Best regards,<br>
> > --<br>
> > Chaitanya kumar CH.<br>
> ><br>
><br>
<br>
<br>
</div></div></blockquote></div><br>