[英]boost::property_tree::json_parser::read_json cannot read files if path contains cyrillic characters
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. 只有std :: string作为参数,没有std :: wstring。 Can anyone help me?
谁能帮我?
This is a limitation inherited from the C++ standard streams. 这是从C ++标准流继承的限制。 Microsoft's streams have a non-standard extension to accept
wstring
paths, but PTree doesn't allow them. Microsoft的流具有接受
wstring
路径的非标准扩展,但是PTree不允许它们。
Try using Boost.Filesystem's streams. 尝试使用Boost.Filesystem的流。 Open the stream outside the function and pass the open stream to
read_json
. 在函数外部打开流,
read_json
打开的流传read_json
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.