I developed a cross-platform qt app on macos and windows,I have a file named 'proj.json', it generated by rapidjson in my app on windows, and on windows its encoding-format is GB2312, now I use rapidjson in my app on mac to analysis proj.json, in the proj.json file there have a string '.\Templates\2D贴纸\2D贴纸.fuproj', in my qt app on mac,I use this code to get the string '.\Templates\2D贴纸\2D贴纸.fuproj'
string pjson = fullfile(folder, "/proj.json");
if (isexist(pjson))
{
rapidjson::Document doc;
bool isReadJsonSuccess;
doc = loadJson(pjson,&isReadJsonSuccess);
if (isReadJsonSuccess){
rapidjson::Value &ps = doc["Projects"];
for (int i = 0; i < ps.Size(); i++) {
rapidjson::Value &item = ps[i];
string str1 = item["path"].GetString();
cout << "str1----" << str1 << endl;
and it logout 'str1----.\Templates\2D\314\371ֽ\2D\314\371ֽ.fuproj',I don't the encoding-format of string '.\Templates\2D\314\371ֽ\2D\314\371ֽ.fuproj', and my qt app on mac runtime encoding-format is 'UTF-8',it seems GB2312 convert to UTF-8 cause that. how let the GB2312 string '.\Templates\2D贴纸\2D贴纸.fuproj' shows right in qt app on macos, thanks a lot!
How about converting it by following method
I didn't test it, hode that can help.