diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 544b4e382..1e4a01a5b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2212,7 +2212,8 @@ int Print::get_hrc_by_nozzle_type(const NozzleType&type) static std::mapnozzle_type_to_hrc; if (nozzle_type_to_hrc.empty()) { fs::path file_path = fs::path(resources_dir()) / "info" / "nozzle_info.json"; - std::ifstream in(file_path.string()); + boost::nowide::ifstream in(file_path.string()); + //std::ifstream in(file_path.string()); json j; try { j = json::parse(in); diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 7682d36a1..2280c270b 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -5534,7 +5534,7 @@ std::vector DeviceManager::get_resolution_supported(std::string typ std::vector resolution_supported; 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()) { @@ -5556,7 +5556,7 @@ std::vector DeviceManager::get_compatible_machine(std::string type_ { std::vector compatible_machine; 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()) { @@ -5575,10 +5575,12 @@ std::vector DeviceManager::get_compatible_machine(std::string type_ } -bool DeviceManager::load_filaments_blacklist_config(std::string config_file) +bool DeviceManager::load_filaments_blacklist_config() { filaments_blacklist = json::object(); - std::ifstream json_file(config_file.c_str()); + + std::string config_file = Slic3r::resources_dir() + "/printers/filaments_blacklist.json"; + boost::nowide::ifstream json_file(config_file.c_str()); try { if (json_file.is_open()) { diff --git a/src/slic3r/GUI/DeviceManager.hpp b/src/slic3r/GUI/DeviceManager.hpp index 10c1e8bf3..d8e885e0c 100644 --- a/src/slic3r/GUI/DeviceManager.hpp +++ b/src/slic3r/GUI/DeviceManager.hpp @@ -1029,7 +1029,7 @@ public: static bool get_printer_is_enclosed(std::string type_str); static std::vector get_resolution_supported(std::string type_str); static std::vector get_compatible_machine(std::string type_str); - static bool load_filaments_blacklist_config(std::string config_file); + static bool load_filaments_blacklist_config(); static void check_filaments_in_blacklist(std::string tag_vendor, std::string tag_type, bool& in_blacklist, std::string& ac, std::string& info); static std::string load_gcode(std::string type_str, std::string gcode_file); }; diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index e27cc9693..9a2c14020 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -1280,8 +1280,7 @@ void GUI_App::post_init() }); - std::string filaments_blacklist_config_file = Slic3r::resources_dir() + "/printers/filaments_blacklist.json"; - DeviceManager::load_filaments_blacklist_config(encode_path(filaments_blacklist_config_file.c_str())); + DeviceManager::load_filaments_blacklist_config(); // remove old log files over LOG_FILES_MAX_NUM std::string log_addr = data_dir();