From dcb006535a2469c8f8b3a16982a0e33193f3d8fa Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Wed, 23 Aug 2023 14:24:12 +0800 Subject: [PATCH] FIX: [STUDIO-4164] charset problem in load printer config Change-Id: Id1ee5108b70e926f822ca4f12715bd2255e5c272 (cherry picked from commit 8ea1abc1df9d1d1680f20c4f9f423360b9318ceb) --- src/slic3r/GUI/DeviceManager.cpp | 2 +- src/slic3r/Utils/json_diff.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index abb8ca0e85..894835a697 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -5056,7 +5056,7 @@ json DeviceManager::filaments_blacklist = json::object(); std::string DeviceManager::get_string_from_config(std::string type_str, std::string item) { std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json"; - std::ifstream json_file(config_file.c_str()); + boost::nowide::ifstream json_file(config_file.c_str()); try { json jj; if (json_file.is_open()) { diff --git a/src/slic3r/Utils/json_diff.cpp b/src/slic3r/Utils/json_diff.cpp index a1e3609f1b..a4f4bbcce6 100644 --- a/src/slic3r/Utils/json_diff.cpp +++ b/src/slic3r/Utils/json_diff.cpp @@ -83,7 +83,7 @@ bool json_diff::load_compatible_settings(std::string const &type, std::string co printer_version = version2; settings_base.clear(); std::string config_file = Slic3r::resources_dir() + "/printers/" + type2 + ".json"; - std::ifstream json_file(config_file.c_str()); + boost::nowide::ifstream json_file(config_file.c_str()); try { json versions; if (json_file.is_open()) {