1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0028454: Data Exchange, STEP reader - names with special characters cannot be read

- Add support of the control directives ( "\X2\" "\X4" "\X\" "\P*\" "\S\");
- Make param "read.stepcaf.codepage" base for conversion inside StepData instead of CAF;
- Rename "read.stepcaf.codepage" to "read.step.codepage".
- Add ISO 8859-1 - 9 code pages for conversion
- Add Resource_FormatType_NoConversion format type, that indicates non-conversion behavior
- Update old test cases that contain control directives
This commit is contained in:
dpasukhi
2020-10-09 13:57:30 +03:00
committed by bugmaster
parent 380748c340
commit 1b9cb073b9
22 changed files with 949 additions and 89 deletions

View File

@@ -258,12 +258,13 @@ TCollection_ExtendedString::TCollection_ExtendedString
// Create an extendedstring from an AsciiString
//---------------------------------------------------------------------------
TCollection_ExtendedString::TCollection_ExtendedString
(const TCollection_AsciiString& theString)
(const TCollection_AsciiString& theString,
const Standard_Boolean isMultiByte)
{
mylength = nbSymbols (theString.ToCString());
mystring = allocateExtChars (mylength);
mystring[mylength] = 0;
if (ConvertToUnicode (theString.ToCString()))
if (isMultiByte && ConvertToUnicode (theString.ToCString()))
{
return;
}
@@ -304,6 +305,20 @@ void TCollection_ExtendedString::AssignCat (const TCollection_ExtendedString& th
mystring[mylength] = 0;
}
// ----------------------------------------------------------------------------
// AssignCat
// ----------------------------------------------------------------------------
void TCollection_ExtendedString::AssignCat(const Standard_Utf16Char theChar)
{
if (theChar != '\0')
{
mystring = reallocateExtChars(mystring, mylength + 1);
mystring[mylength] = theChar;
mylength += 1;
mystring[mylength] = '\0';
}
}
// ----------------------------------------------------------------------------
// Cat
// ----------------------------------------------------------------------------

View File

@@ -114,8 +114,9 @@ public:
//! Creation by converting an Ascii string to an extended
//! string. The string is treated as having UTF-8 coding.
//! If it is not a UTF-8 then each character is copied to ExtCharacter.
Standard_EXPORT TCollection_ExtendedString(const TCollection_AsciiString& astring);
//! If it is not a UTF-8 or multi byte then
//! each character is copied to ExtCharacter.
Standard_EXPORT TCollection_ExtendedString(const TCollection_AsciiString& astring, const Standard_Boolean isMultiByte = Standard_True);
//! Appends the other extended string to this extended string.
//! Note that this method is an alias of operator +=.
@@ -125,6 +126,9 @@ void operator += (const TCollection_ExtendedString& other)
{
AssignCat(other);
}
//! Appends the utf16 char to this extended string.
Standard_EXPORT void AssignCat (const Standard_Utf16Char theChar);
//! Appends <other> to me.
Standard_EXPORT TCollection_ExtendedString Cat (const TCollection_ExtendedString& other) const;