diff --git a/src/libslic3r/NSVGUtils.cpp b/src/libslic3r/NSVGUtils.cpp index 6e486d9a15..21fde6b9d0 100644 --- a/src/libslic3r/NSVGUtils.cpp +++ b/src/libslic3r/NSVGUtils.cpp @@ -6,6 +6,7 @@ #include #include // to_chars +#include #include "ClipperUtils.hpp" #include "Emboss.hpp" // heal for shape @@ -100,7 +101,7 @@ NSVGimage_ptr nsvgParseFromFile(const std::string &filename, const char *units, std::unique_ptr read_from_disk(const std::string &path) { - std::ifstream fs{path}; + boost::nowide::ifstream fs{path}; if (!fs.is_open()) return nullptr; std::stringstream ss; diff --git a/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp b/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp index 51191fcf22..512134ba42 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoSVG.cpp @@ -2202,12 +2202,14 @@ EmbossShape select_shape(std::string_view filepath, double tesselation_tolerance shape.svg_file.path = filepath; // copy } - if (!boost::filesystem::exists(shape.svg_file.path)) { + + boost::filesystem::path path(shape.svg_file.path); + if (!boost::filesystem::exists(path)) { show_error(nullptr, GUI::format(_u8L("File does NOT exist (%1%)."), shape.svg_file.path)); return {}; } - if (!boost::algorithm::iends_with(shape.svg_file.path, ".svg")){ + if (!boost::algorithm::iends_with(shape.svg_file.path, ".svg")) { show_error(nullptr, GUI::format(_u8L("Filename has to end with \".svg\" but you selected %1%"), shape.svg_file.path)); return {}; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 1c2651d881..b25efeaedf 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -1645,7 +1645,7 @@ private: namespace { bool emboss_svg(Plater& plater, const wxString &svg_file, const Vec2d& mouse_drop_position) { - std::string svg_file_str = svg_file.ToStdString(); + std::string svg_file_str = into_u8(svg_file); GLCanvas3D* canvas = plater.canvas3D(); if (canvas == nullptr) return false;