[Nowide] Nowide and Property Tree file IO

William Kappler via Boost-users <[email protected]>
Newsgroups gmane.comp.lib.boost.user
Message-ID <CABTxdakOjH5XbTfH35z1pqmS+EvZrH8h6KhS3Hvzpa2f6D8iHA@mail.gmail.com>
 I'm trying to sidestep some issues with unicode filenames on Windows
(MSYS64) using Boost.Nowide. Specifically, my program operates in UTF-8,
and providing that to std/Boost functions yields incorrect filenames due to
them being interpreted as UTF-16 (or something along those lines).

However, the primary functions I have issues with are from
Boost.PropertyTree. Specifically, read_json and write_json. These functions
don't seem to be Nowide-friendly.

I tried just calling boost::nowide::nowide_filesystem() before my json
calls, hoping it would work; it did not, I got the same mangled filenames.
My next thought was to see if a nowide stream could be substituted into the
stream-taking variants of read_json/write_json; it cannot be, they aren't
compatible.

The only option that seems to leave is something along these lines:
https://stackoverflow.com/a/21537818, but using Nowide to read in the file.
That adds a lot of steps (and possibly memory usage). It feels like I'm
missing something.

Any suggestions would be appreciated. Thanks in advance.

:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-:-
*William E. Kappler II*
Software Designer and Programmer
william-kappler.com

_______________________________________________
Boost-users mailing list
[email protected]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.