diff --git a/src/libslic3r/Format/STEP.cpp b/src/libslic3r/Format/STEP.cpp index 283fe63798..a637cdd3ca 100644 --- a/src/libslic3r/Format/STEP.cpp +++ b/src/libslic3r/Format/STEP.cpp @@ -182,7 +182,7 @@ static void getNamedSolids(const TopLoc_Location& location, const std::string& p if (referredLabel.FindAttribute(TDataStd_Name::GetID(), shapeName)) name = TCollection_AsciiString(shapeName->Get()).ToCString(); - if (name == "") + if (name == "" || !StepPreProcessor::isUtf8(name)) name = std::to_string(id++); std::string fullName{name}; diff --git a/src/libslic3r/Format/STEP.hpp b/src/libslic3r/Format/STEP.hpp index 72f8327106..64e52aa9be 100644 --- a/src/libslic3r/Format/STEP.hpp +++ b/src/libslic3r/Format/STEP.hpp @@ -42,8 +42,8 @@ class StepPreProcessor { public: bool preprocess(const char* path, std::string &output_path); static bool isUtf8File(const char* path); -private: static bool isUtf8(const std::string str); +private: static bool isGBK(const std::string str); static int preNum(const unsigned char byte); //BBS: default is UTF8 for most step file.