boost::property_tree::json_parser::read_json cannot read files if path contains cyrillic characters

829 Views Asked by At

Is it possible to open files that have cyrillic parts in their path? I am able to read/write cyrillic contents of files, but I do not know how to open the file as

json_parser::read_json 

only has std::string as a parameter and no std::wstring. Can anyone help me?

1

There are 1 best solutions below

0
On BEST ANSWER

This is a limitation inherited from the C++ standard streams. Microsoft's streams have a non-standard extension to accept wstring paths, but PTree doesn't allow them.

Try using Boost.Filesystem's streams. Open the stream outside the function and pass the open stream to read_json.