[PROJ] PROJ and Unicode on Windows

Even Rouault even.rouault at spatialys.com
Wed Apr 5 14:52:55 PDT 2023


Peter,

there isn't any issue in your build. It is just that PROJ returns UTF-8 
encoded strings and that the typical Windows console isn't configured to 
display UTF-8. Cf 
https://stackoverflow.com/questions/57131654/using-utf-8-encoding-chcp-65001-in-command-prompt-windows-powershell-window 
or similar issues

Even

Le 05/04/2023 à 23:44, Peter Townsend via PROJ a écrit :
> I've got a bit of an annoyance with my windows proj build. Hopefully 
> it's not too hard to resolve as the world of char/wchar_t/etc. isn't 
> something I'm terribly familiar with.
>
> Take for example the area of use of EPSG:23031. On Linux it's fine, 
> but on windows there's a unicode issue.
>
> PJ* crs = proj_create(m_ctxt, "EPSG:23031");
> ASSERT_NE(crs, nullptr);
> ObjectKeeper keeper_crsH(crs);
>
> double w, s, e, n;
> const char* a;
> proj_get_area_of_use(m_ctxt, crs, &w, &s, &e, &n, &a);
>
> Contents of a:
> "Europe - between 0°E and 6°E - Andorra; Denmark (North Sea); 
> Germany offshore; Netherlands offshore; Norway including Svalbard - 
> onshore and offshore; Spain - onshore (mainland and Balearic Islands); 
> United Kingdom (UKCS) offshore."
>
> Is there a simple thing I'm overlooking in the build process that 
> might clear up the encoding goof? Or do I need to do some bending over 
> backwards with character manipulation?
>
> This is the command line I'm using to build this example:
> cmake -DBUILD_SHARED_LIBS=ON 
> -DCMAKE_TOOLCHAIN_FILE=C:\dev\vcpkg\scripts\buildsystems\vcpkg.cmake ..
> cmake --build . --config Debug -j 8
>
> Thanks!
> -- 
> Peter Townsend
> Senior Software Developer
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230405/8ae24f16/attachment.htm>


More information about the PROJ mailing list