1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0031878: DXF import - support Windows and ISO 8859 code pages in DXF import

Add support of converting Big5 and GBK code pages to Unicode within Resource_Unicode::ConvertFormatToUnicode
This commit is contained in:
dpasukhi 2020-10-28 15:13:56 +03:00 committed by bugmaster
parent 40858cc79c
commit 71af3370c4
2 changed files with 19 additions and 0 deletions

View File

@ -51,6 +51,10 @@ enum Resource_FormatType
Resource_FormatType_iso8859_8, //!< ISO 8859-8 (Hebrew) encoding
Resource_FormatType_iso8859_9, //!< ISO 8859-9 (Turkish) encoding
// Addition code pages
Resource_FormatType_GBK, //!< GBK (UnifiedChinese) encoding
Resource_FormatType_Big5, //!< Big5 (TradChinese) encoding
// old aliases
Resource_FormatType_ANSI = Resource_FormatType_NoConversion,
Resource_SJIS = Resource_FormatType_SJIS,

View File

@ -652,6 +652,16 @@ void Resource_Unicode::ConvertFormatToUnicode (const Resource_FormatType theForm
}
break;
}
case Resource_FormatType_Big5:
{
ConvertBig5ToUnicode(theFromStr, theToStr);
break;
}
case Resource_FormatType_GBK:
{
ConvertGBKToUnicode(theFromStr, theToStr);
break;
}
case Resource_FormatType_UTF8:
{
theToStr = TCollection_ExtendedString (theFromStr, Standard_True);
@ -760,6 +770,11 @@ Standard_Boolean Resource_Unicode::ConvertUnicodeToFormat(const Resource_FormatT
const NCollection_Utf16String aString (theFromStr.ToExtString());
return aString.ToLocale (theToStr, theMaxSize);
}
case Resource_FormatType_GBK:
case Resource_FormatType_Big5:
{
throw Standard_NotImplemented("Resource_Unicode::ConvertUnicodeToFormat - convert from GBK and Big5 to Unocode is not implemented");
}
}
return Standard_False;
}