1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0014673: Provide true support for Unicode symbols

Construction of TCollection_ExtendedString from plain C string is fixed to consider input string as UTF-8 in several places (identified as described in notes to #31113).

Message_MsgFile is corrected to load resource file as UTF-8 (unless it has BOM indicating use of UTF-16).

Added tests for use of Unicode in some DRAW commands (bugs demo bug14673_*)
This commit is contained in:
abv
2020-10-25 22:10:27 +03:00
committed by bugmaster
parent aa7e9f8d78
commit 94f16a8961
17 changed files with 177 additions and 48 deletions

View File

@@ -194,7 +194,7 @@ static Standard_Integer saveModel (Draw_Interpretor& di, Standard_Integer argc,
if ( aModel.IsNull() ) return 1;
Standard_Boolean isSaved = Standard_False;
if (argc > 2 )
isSaved = aModel->SaveAs( argv[2] );
isSaved = aModel->SaveAs( TCollection_ExtendedString (argv[2], Standard_True) );
else
isSaved = aModel->Save();
@@ -215,11 +215,12 @@ static Standard_Integer loadModel (Draw_Interpretor& di, Standard_Integer argc,
Standard_Boolean isLoaded = Standard_False;
Handle(TObj_Model) aModel = getModelByName(argv[1]);
TCollection_ExtendedString aPath(argv[2], Standard_True);
if ( aModel.IsNull() )
{
// create new
aModel = new TObjDRAW_Model();
isLoaded = aModel->Load( argv[2] );
isLoaded = aModel->Load(aPath);
if ( isLoaded )
{
Handle(TDocStd_Document) D = aModel->GetDocument();
@@ -230,7 +231,9 @@ static Standard_Integer loadModel (Draw_Interpretor& di, Standard_Integer argc,
}
}
else
isLoaded = aModel->Load( argv[2] );
{
isLoaded = aModel->Load(aPath);
}
if (!isLoaded) {