#4271: Use OS independent utf8 string representation of std_fs::path at to_j…#4502
#4271: Use OS independent utf8 string representation of std_fs::path at to_j…#4502zel1b08a wants to merge 4 commits intonlohmann:developfrom
Conversation
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @zel1b08a |
|
Please run |
| inline void to_json(BasicJsonType& j, const std_fs::path& p) | ||
| { | ||
| j = p.string(); | ||
| j = p.u8string(); |
There was a problem hiding this comment.
Note that from C++20, u8string will return std::u8string instead of std::string - I am not sure if this assignment works in this case.
There was a problem hiding this comment.
I see the copy with reinterpret_cast to char* there only..)
There was a problem hiding this comment.
I saw a remark on cppreference.com
There was a problem hiding this comment.
I mean the u8string to string conversion here in that issue
|
The exception could come from the conversion of |
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @zel1b08a |
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @zel1b08a |
|
This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions! |
|
I believe this has been resolved by #4631 and could be closed. |
According to #4271.
std::filesystem::path::stringmethod uses system-dependent native format.Stringtype is alwaysUTF8format, by the json docs. So we force encoding to beUTF8.