mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0031113: Foundation Classes - TCollection_ExtendedString constructor from CString is confusing
In constructor of TCollection_ExtendedString from Standard_CSTring (const char*), default value for the second argument (isMultiByte) is changed from False to True, for consistency with constructor from TCollection_AsciiString and adopted approach of using UTF-8 encoding for Unicode strings across OCCT.
This commit is contained in:
@@ -208,7 +208,7 @@ static Standard_Integer DDataStd_SetComment (Draw_Interpretor& di,
|
||||
if (!DDF::GetDF(arg[1],DF)) return 1;
|
||||
TDF_Label L;
|
||||
DDF::AddLabel(DF, arg[2], L);
|
||||
TDataStd_Comment::Set(L,TCollection_ExtendedString(arg[3],Standard_True));
|
||||
TDataStd_Comment::Set(L,arg[3]);
|
||||
return 0;
|
||||
}
|
||||
di << "DDataStd_SetComment : Error\n";
|
||||
|
@@ -64,7 +64,7 @@ static Standard_Integer DDataStd_SetName (Draw_Interpretor& di,
|
||||
return 1;
|
||||
}
|
||||
Standard_GUID guid(arg[4]);
|
||||
TDataStd_Name::Set(L, guid, TCollection_ExtendedString(arg[3],Standard_True));
|
||||
TDataStd_Name::Set(L, guid, arg[3]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -63,12 +63,13 @@ public:
|
||||
//! Initializes a ExtendedString to an empty ExtendedString.
|
||||
Standard_EXPORT TCollection_ExtendedString();
|
||||
|
||||
//! Creation by converting a CString to an extended
|
||||
//! string. If <isMultiByte> is true then the string is
|
||||
//! treated as having UTF-8 coding. If it is not a UTF-8
|
||||
//! then <isMultiByte> is ignored and each character is
|
||||
//! copied to ExtCharacter.
|
||||
Standard_EXPORT TCollection_ExtendedString(const Standard_CString astring, const Standard_Boolean isMultiByte = Standard_False);
|
||||
//! Creation by converting a plain C string to an extended string.
|
||||
//! If @p isMultiByte is true then @p theString is treated as having UTF-8 encoding.
|
||||
//! If @p isMultiByte is true but @p theString is not a valid UTF-8 string,
|
||||
//! or if @p isMultiByte is false, then each character of @p theString is
|
||||
//! copied to ExtCharacter (as if @p theString was in ISO 8859-1 code page).
|
||||
Standard_EXPORT TCollection_ExtendedString(const Standard_CString theString,
|
||||
const Standard_Boolean isMultiByte = Standard_True);
|
||||
|
||||
//! Creation by converting an ExtString to an extended string.
|
||||
Standard_EXPORT TCollection_ExtendedString(const Standard_ExtString astring);
|
||||
|
@@ -201,7 +201,7 @@ static Standard_Integer ReadGltf (Draw_Interpretor& theDI,
|
||||
else
|
||||
{
|
||||
Handle(DDocStd_DrawDocument) aDrawDoc = new DDocStd_DrawDocument (aDoc);
|
||||
TDataStd_Name::Set (aDoc->GetData()->Root(), aDestName.ToCString());
|
||||
TDataStd_Name::Set (aDoc->GetData()->Root(), aDestName);
|
||||
Draw::Set (aDestName.ToCString(), aDrawDoc);
|
||||
}
|
||||
}
|
||||
@@ -604,7 +604,7 @@ static Standard_Integer ReadObj (Draw_Interpretor& theDI,
|
||||
else
|
||||
{
|
||||
Handle(DDocStd_DrawDocument) aDrawDoc = new DDocStd_DrawDocument (aDoc);
|
||||
TDataStd_Name::Set (aDoc->GetData()->Root(), aDestName.ToCString());
|
||||
TDataStd_Name::Set (aDoc->GetData()->Root(), aDestName);
|
||||
Draw::Set (aDestName.ToCString(), aDrawDoc);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user