Select code page during STEP Import (#14416)
* [STEP Import] Added the ability to select the encoding of the source file when importing. Requires OCCT version 7.8.0 and higher * fix compile error for OCCT < 7.8.0 * Also hide label "CodePage" for OCCT < 7.8.0 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix error * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix error on Ubuntu 20-04 * Fix error on Ubuntu 20-04 --------- Co-authored-by: Kuzma30 <kuzemkoa@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2ebb20c698
commit
173733750b
@@ -157,9 +157,16 @@ private:
|
||||
hApp->NewDocument(TCollection_ExtendedString("MDTV-CAF"), hDoc);
|
||||
|
||||
if (file.hasExtension({"stp", "step"})) {
|
||||
#if OCC_VERSION_HEX >= 0x070800
|
||||
Resource_FormatType cp = Resource_FormatType_UTF8;
|
||||
#endif
|
||||
try {
|
||||
Import::ReaderStep reader(file);
|
||||
#if OCC_VERSION_HEX < 0x070800
|
||||
reader.read(hDoc);
|
||||
#else
|
||||
reader.read(hDoc, cp);
|
||||
#endif
|
||||
}
|
||||
catch (OSD_Exception& e) {
|
||||
Base::Console().Error("%s\n", e.GetMessageString());
|
||||
|
||||
Reference in New Issue
Block a user