From: mbs Date: Mon, 25 Sep 2023 17:13:47 +0000 (+0100) Subject: bug fix for bos#37741: EDF 28623 : import fails with accent characters X-Git-Tag: V9_12_0a1~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=241b1234365e3f65b9b84c7c8eccf072be54b68c;hp=d72659ced7d4046a5142b897f8f5c3652d61dbb9;p=modules%2Fshaper.git bug fix for bos#37741: EDF 28623 : import fails with accent characters --- diff --git a/src/ExchangePlugin/Test/TestImport.py b/src/ExchangePlugin/Test/TestImport.py index 11944de39..56d89bf88 100644 --- a/src/ExchangePlugin/Test/TestImport.py +++ b/src/ExchangePlugin/Test/TestImport.py @@ -156,6 +156,8 @@ if __name__ == '__main__': testImport("BREP", shape_path, 259982.297176, 39481.415022205365, 10 ** -5) shape_path = shutil.copyfile(shape_path, os.path.join(tmp_dir, "solid.brp")) testImport("BRP", shape_path, 259982.297176, 39481.415022205365, 10 ** -5) + shape_path = shutil.copyfile(shape_path, os.path.join(tmp_dir, "pièce.brep")) + testImport("BREP", shape_path, 259982.297176, 39481.415022205365, 10 ** -5) #========================================================================= # Create a shape imported from STEP #========================================================================= diff --git a/src/Model/Model_AttributeString.cpp b/src/Model/Model_AttributeString.cpp index c212511d2..6e20020fe 100644 --- a/src/Model/Model_AttributeString.cpp +++ b/src/Model/Model_AttributeString.cpp @@ -35,7 +35,9 @@ static const Standard_GUID kUVALUE_IDENTIFIER("04cac509-b2fc-4887-b442-d2a86f2fd void Model_AttributeString::setValue(const std::string& theValue) { - TCollection_ExtendedString aValue(theValue.c_str()); + // Always assume the std::string to be a multi-byte character string + // as it can contain accents or other special characters, too! + TCollection_ExtendedString aValue(theValue.c_str(), true); if (!myIsInitialized || myString->Get() != aValue) { if (myString.IsNull()) myString = TDataStd_Name::Set(myLab, TCollection_ExtendedString());