diff --git a/src/tools/prefs.win.cpp b/src/tools/prefs.win.cpp index 7f350532..179f0566 100644 --- a/src/tools/prefs.win.cpp +++ b/src/tools/prefs.win.cpp @@ -104,9 +104,11 @@ static bool save_prefs(fs::path fpath) { else if(kv.second.type() == typeid(double)) fout << kv.first << " = " << std::fixed << boost::any_cast(kv.second) << std::endl; else if(kv.second.type() == typeid(std::string)){ - std::string encoded; - TiXmlBase::EncodeString(boost::any_cast(kv.second), &encoded); - fout << kv.first << " = \"" << encoded << "\"" << std::endl; + std::string value = boost::any_cast" << val.substr(1, val.size() - 2) << ""; - TiXmlElement text_element(""); - text_element.Parse(dummy_xml.str().c_str(), nullptr, TIXML_ENCODING_UTF8); - std::string decoded = text_element.GetText(); - temp_prefs[key] = decoded; + else if(val[0] == '"' || val[0] == '\'') { + std::istringstream str_val(val); + std::string value = read_maybe_quoted_string(str_val); + temp_prefs[key] = value; } else if(val[0] == '[') { int arr_end = val.find_first_of(']'); std::istringstream arr_vals(val.substr(1, arr_end - 1));