1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +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

@@ -127,7 +127,7 @@ static Standard_Integer DDocStd_Open (Draw_Interpretor& di,
const char** a)
{
if (nb >= 3) {
TCollection_ExtendedString path (a[1]);
TCollection_ExtendedString path (a[1], Standard_True);
Handle(TDocStd_Application) A = DDocStd::GetApplication();
Handle(TDocStd_Document) D;
Standard_Integer insession = A->IsInSession(path);
@@ -245,7 +245,7 @@ static Standard_Integer DDocStd_SaveAs (Draw_Interpretor& di,
if (nb >= 3) {
Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(a[1],D)) return 1;
TCollection_ExtendedString path (a[2]);
TCollection_ExtendedString path (a[2], Standard_True);
Handle(TDocStd_Application) A = DDocStd::GetApplication();
PCDM_StoreStatus theStatus;
@@ -423,7 +423,7 @@ static Standard_Integer DDocStd_Path (Draw_Interpretor& di,
const char** a)
{
if (nb == 2) {
TDocStd_PathParser path (a[1]);
TDocStd_PathParser path (TCollection_ExtendedString (a[1], Standard_True));
di << "Trek : " << path.Trek() << "\n";
di << "Name : " << path.Name() << "\n";
di << "Extension : " << path.Extension() << "\n";
@@ -445,7 +445,7 @@ static Standard_Integer DDocStd_AddComment (Draw_Interpretor& di,
if (nb == 3) {
Handle(TDocStd_Document) D;
if (!DDocStd::GetDocument(a[1],D)) return 1;
TCollection_ExtendedString comment (a[2]);
TCollection_ExtendedString comment (a[2], Standard_True);
// Handle(TDocStd_Application) A = DDocStd::GetApplication();
// A->AddComment(D,comment);
D->AddComment(comment);

View File

@@ -109,7 +109,7 @@ static int mtmCommitTransaction (Draw_Interpretor& di, int n, const char** a)
return 1;
}
if(n > 1)
sMultiTransactionManager->CommitCommand(a[1]);
sMultiTransactionManager->CommitCommand(TCollection_ExtendedString (a[1], Standard_True));
else
sMultiTransactionManager->CommitCommand();
return 0;