[PROJ] PROJ and Unicode on Windows

Dan Crosby dan.crosby at lincolnagritech.co.nz
Wed Apr 5 16:50:54 PDT 2023


I guess this is just a matter of taste/habit. Lots of open source libraries that return Unicode content just return it as UTF-8 in a char* (or a std::string in C++. this is typically the case of the nlohmann/json library we use for JSON parsing).  If you need to access the string by Unicode character, you can use iconv or https://en.cppreference.com/w/cpp/locale/codecvt_utf8 in C++ (although the latter has been deprecated).
 

            You are probably right about taste/habit, especially for projects that didn’t start as UNICODE builds. However, I sometimes think open source efforts do themselves no favours in (seemingly deliberately) making themselves harder to use. Especially to ‘casual’ users like myself.
 
For instance, nothing in the reference documentation for proj_get_area_of_use suggests that out_area_name returns a UTF string, so if you take it “at its word” and place the result in a char* you get encoding errors for “unknown” reasons.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20230406/db9cc11b/attachment.htm>


More information about the PROJ mailing list