View Issue Details

IDProjectCategoryView StatusLast Update
0031589CommunityOCCT:Data Exchangepublic2020-12-02 17:12
Reporterrobertlipman Assigned Torobertlipman  
PrioritynormalSeveritycrash 
Status closedResolutionfixed 
Product Version7.2.0 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031589: Data Exchange - unable to read STEP file containing mangled characters
DescriptionI downloaded a STEP file from GrabCAD and CAD Assistant. The STEP file can be downloaded from https://grabcad.com/library/snowblower-2

Some of the text strings have characters that are not correctly encoded. For example, in the FILE_NAME in the header section, # 98, # 625, and more. There is even a note in the HEADER section indicating that the \X\ encoding is not used.

Although the characters do not correctly use Unicode characters, CAD Assistant should be able to handle them in some way. Every other viewer that I have tried does not have any problem with those characters.
Steps To ReproduceImport the STEP file available at https://grabcad.com/library/snowblower-2 and test with CAD Assistant.
TagsNo tags attached.
Test case numberbugs step bug30397

Relationships

related to 0031670 closedbugmaster Community Data Exchange - cp1251 Cyrillic characters in STEP file 

Activities

abv

2020-10-06 22:33

manager   ~0095767

This works for me on current master; Dmitry, can you check this please and see whether we need to add a test case for this issue?

dpasukhi

2020-10-21 11:08

administrator   ~0096094

Dear bugmaster,
please close the issue.
The current bug case has been fixed with #30397, so its test case is enough for check read unsupported symbol.

abv

2020-10-23 08:58

manager   ~0096160

Last edited: 2020-10-23 08:58

Hello Robert,

We have improved OCCT to handle different types of character encodings possible in STEP files. You can try this on beta version of OCCT 7.5.0 (see https://dev.opencascade.org/index.php?q=node/1305).

One point to note is that STEP file normally is expected to contain strings in UTF-8 encoding (or old \X* control directives), which is not the case for the file you mentioned in the issue description. In order to read correctly strings within this kind of files (written using 8-bit encoding in some - unknown in general case! - code page), you will need to specify explicitly what encoding is to be used. This is now possible with Interface_Static parameter read.step.codepage.

If this parameter is set to "CP1252", then we can successfully read names of entities encoded using CP1252 encoding, such as

# 625=NEXT_ASSEMBLY_USAGE_OCCURRENCE('szíj_elsõ_feszített',
'szíj_elsõ_feszített','szíj_elsõ_feszített',#247096,#247181,'');


However, some of the test strings in that file seem to be completely broken and cannot be converted into anything sensible. In particular, the first entity you mentioned:

# 98=MANIFOLD_SOLID_BREP(
'Âűđĺç-Âűň˙íóňü7',#130254);


You wrote that "Every other viewer that I have tried does not have any problem with those characters.". Does this mean that these viewers are able to show this string as some reasonable text? If so, could you please give examples of what viewers you have used, and this text is displayed (snapshots would be OK)?

Thank you in advance!

Andrey

robertlipman

2020-10-26 21:07

reporter   ~0096281

Last edited: 2020-10-26 21:33

There are three free viewers that I test STEP files with, C3D Viewer, Solidworks eDrawings Viewer, and VariCAD. Links to all of them are on https://www.cax-if.org/step_viewers.php

eDrawings does not show the correct characters. C3D viewer does show the correct characters but I haven't check that closely. I don't know how to see the characters in VariCAD.

At least CAD Assistant shouldn't crash with this file.

Here's another file with cyrillic characters to test.
https://grabcad.com/library/tilt-angle-indicator-1/details?folder_id=9249593

robertlipman

2020-10-26 21:08

reporter   ~0096282

I forwarded the information about the beta version to my developer. Hopefully, he can test it out soon.

abv

2020-10-31 09:19

manager   ~0096417

I have checked the original file with C3D viewer:
- it does not show names of solids, thus name of entity #98 cannot be seen there
- it loads all texts as if they were in CP1251, even if the file is saved in UTF-8
- it does not support characters encoded using STEP control directives except \X2\
Thus it cannot be used as reference for correct reading of characters from STEP.

I consider now this issue as verified, please comment if you find any issues on the subject (or create separate issue).

Related Changesets

occt: master e0a25f3d

2020-09-09 10:02:39

abv


Committer: abv Details Diff
0030397: Data Exchange - STEP Reader extension to support entities which have a text description field with not supported symbols

STEP file is now opened in binary mode (instead of text mode) to avoid unexpected handling of control symbols inside string constants.
Affected Issues
0031589
mod - src/StepFile/stepread.c Diff File
add - tests/bugs/step/bug30397 Diff File

Issue History

Date Modified Username Field Change
2020-06-02 17:08 robertlipman New Issue
2020-06-02 17:08 robertlipman Assigned To => gka
2020-06-04 14:29 kgv Summary CAD Assistant will not read STEP file => Data Exchange - CAD Assistant will not read STEP file
2020-06-04 14:29 kgv Description Updated
2020-06-04 14:45 kgv Product Version => 7.2.0
2020-06-04 14:45 kgv Target Version => 7.5.0
2020-06-04 14:45 kgv Summary Data Exchange - CAD Assistant will not read STEP file => Data Exchange - unable to read STEP file containing mangled characters
2020-07-16 23:17 robertlipman Assigned To gka => robertlipman
2020-07-16 23:59 robertlipman Assigned To robertlipman => gka
2020-07-24 13:03 kgv Relationship added related to 0031670
2020-09-11 17:23 gka Target Version 7.5.0 => 7.6.0
2020-10-06 22:33 abv Note Added: 0095767
2020-10-06 22:33 abv Assigned To gka => dpasukhi
2020-10-06 22:33 abv Status new => assigned
2020-10-06 22:33 abv Target Version 7.6.0 => 7.5.0
2020-10-21 11:08 dpasukhi Note Added: 0096094
2020-10-21 11:08 dpasukhi Assigned To dpasukhi => bugmaster
2020-10-21 11:08 dpasukhi Status assigned => feedback
2020-10-21 12:30 abv Changeset attached => occt master e0a25f3d
2020-10-21 12:31 abv Test case number => bugs step bug30397
2020-10-21 12:32 abv Assigned To bugmaster => abv
2020-10-23 08:29 abv Assigned To abv => robertlipman
2020-10-23 08:58 abv Note Added: 0096160
2020-10-23 08:58 abv Note Edited: 0096160
2020-10-26 21:07 robertlipman Note Added: 0096281
2020-10-26 21:08 robertlipman Note Added: 0096282
2020-10-26 21:33 robertlipman Note Edited: 0096281
2020-10-31 09:19 abv Note Added: 0096417
2020-10-31 09:20 abv Status feedback => verified
2020-10-31 09:20 abv Resolution open => fixed
2020-12-02 16:22 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed