mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-10 18:51: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:
parent
40858cc79c
commit
71af3370c4
@ -51,6 +51,10 @@ enum Resource_FormatType
|
|||||||
Resource_FormatType_iso8859_8, //!< ISO 8859-8 (Hebrew) encoding
|
Resource_FormatType_iso8859_8, //!< ISO 8859-8 (Hebrew) encoding
|
||||||
Resource_FormatType_iso8859_9, //!< ISO 8859-9 (Turkish) 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
|
// old aliases
|
||||||
Resource_FormatType_ANSI = Resource_FormatType_NoConversion,
|
Resource_FormatType_ANSI = Resource_FormatType_NoConversion,
|
||||||
Resource_SJIS = Resource_FormatType_SJIS,
|
Resource_SJIS = Resource_FormatType_SJIS,
|
||||||
|
@ -652,6 +652,16 @@ void Resource_Unicode::ConvertFormatToUnicode (const Resource_FormatType theForm
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Resource_FormatType_Big5:
|
||||||
|
{
|
||||||
|
ConvertBig5ToUnicode(theFromStr, theToStr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case Resource_FormatType_GBK:
|
||||||
|
{
|
||||||
|
ConvertGBKToUnicode(theFromStr, theToStr);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Resource_FormatType_UTF8:
|
case Resource_FormatType_UTF8:
|
||||||
{
|
{
|
||||||
theToStr = TCollection_ExtendedString (theFromStr, Standard_True);
|
theToStr = TCollection_ExtendedString (theFromStr, Standard_True);
|
||||||
@ -760,6 +770,11 @@ Standard_Boolean Resource_Unicode::ConvertUnicodeToFormat(const Resource_FormatT
|
|||||||
const NCollection_Utf16String aString (theFromStr.ToExtString());
|
const NCollection_Utf16String aString (theFromStr.ToExtString());
|
||||||
return aString.ToLocale (theToStr, theMaxSize);
|
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;
|
return Standard_False;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user