Replies: 1 comment
-
I can't speak for nlohmann but I imagine that there would be support for a PR to make it work properly on Windows if it could be done reasonably and to cover all cases. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey y'all,
I'd love some feedback on an issue I'm facing, along with an idea for how to solve it.
I rely on this absolutely amazingly useful library (
nlohmann::json
) to communicate between a C++ back-end and a JavaScript front-end.As is often pointed out in various support tickets,
nlohmann::json
only supports Utf-8, and (to the best of my knowledge) Windows uses Utf-16 inside of std::filesystem::path, and my attempts to change this, e.g. via compiler option/execution-charset:utf-8
have yielded no change.It seems to me that an easy and generally encapsulated solution is provide my own custom to_json and from_json converters and manually convert the std::string inside of std::filesystem::path to be Utf-8 and back again. As far as I know, I think I'd have to manually set
JSON_HAS_FILESYSTEM
to 0.Anyone see an issue with this approach or something else I'd have to do to fix it?
Cheers
Gazoo
Beta Was this translation helpful? Give feedback.
All reactions