View Issue Details

IDProjectCategoryView StatusLast Update
0031851Open CASCADEOCCT:Data Exchangepublic2020-12-02 17:13
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031851: Data Exchange, STEP - enable Unicode symbols in STEP export
DescriptionCurrent version of OCCT converts any Unicode (non-Ascii) symbol to '?' when exporting strings (e.g. names of shapes in XDE document) to STEP.

This should be corrected - Unicode symbols should be written either in UTF-8 encoding (allowed by modern edition of STEP ISO10303-21, see e.g. http://www.steptools.com/stds/step/IS_final_p21e3.html) or using legacy /X2/ or /X4/ control directives (see 0028454).

Note that this change will break a non-conformant but still usable approach possible now - use of local 8-bit encoding for strings.
Steps To Reproduce
pload XDE
ReadStep D [locate_data_file utf8.stp]
WriteStep D $imagedir/utf8_saved.stp
ReadStep T $imagedir/utf8_saved.stp

set arabic [GetName T 0:1:1:1]
if { $arabic != "\u0627\u0644\u0645\u062C\u0633\u0645" } {
   puts "Error: arabic symbols get lost"
}
Additional information
and documentation updates
To convert Unicode string to escaped representation, suitable for placing into pure Ascii Tcl script, online services can be used, for instance
https://www.freeformatter.com/java-dotnet-escape.html
TagsNo tags attached.
Test case numberbugs/xde/bug31851

Attached Files

  • utf8.stp (442,283 bytes)

Relationships

related to 0028454 closedbugmaster Community Data Exchange, STEP reader - names with special characters cannot be read 
has duplicate 0031182 closedgka Community Data Exchange - STEP export unicode name as "???" 
child of 0022484 closedbugmaster Open CASCADE UNICODE characters support. 

Activities

abv

2020-10-14 08:53

manager  

utf8.stp (442,283 bytes)

git

2020-10-14 09:11

administrator   ~0095946

Branch CR31851 has been created by abv.

SHA-1: 760bb85212c6761ee065667df4c17b11062c58e3


Detailed log of new commits:

Author: abv
Date: Wed Oct 14 09:14:04 2020 +0300

    0031851: Data Exchange, STEP - enable Unicode symbols in STEP export
    
    Class STEPCAFControl_Writer is corrected to avoid replacing non-Ascii symbols by question marks on export to STEP.
    
    Related: DRAW commands dealing with strings in OCAF documents are corrected to pass Unicode symbols as UTF-8.
    
    Off-topic: code saving names of external STEP files in XDE and fetching them back is corrected to preserve Unicode symbols as UTF-8.
    
    Added test bugs xde bug31851

kgv

2020-10-14 09:46

developer   ~0095950

Could you please remove redundant .ToCString() / .ToExtString() calls around affected lines?

git

2020-10-14 10:00

administrator   ~0095953

Branch CR31851 has been updated by abv.

SHA-1: 712730c1ea3f5c8956d311a6d0deee7a19214ccc


Detailed log of new commits:

Author: abv
Date: Wed Oct 14 10:03:48 2020 +0300

    # review remarks

git

2020-10-14 12:16

administrator   ~0095957

Branch CR31851 has been updated by abv.

SHA-1: a453c85574f19fa2f3b337bcbff3ce109de0a34b


Detailed log of new commits:

Author: abv
Date: Wed Oct 14 12:17:18 2020 +0300

    Test de step_4 E7 corrected (no more replacement of spaces by underscores in names of layers)
    
    On previous commit:
    Related: avoid replacing spaces by underscores in strings on reading from STEP.

git

2020-10-14 12:18

administrator   ~0095958

Branch CR31851_1 has been created by abv.

SHA-1: 5847fc2de29ea225f646b7ed84a924315655e846


Detailed log of new commits:

Author: abv
Date: Wed Oct 14 09:14:04 2020 +0300

    0031851: Data Exchange, STEP - enable Unicode symbols in STEP export
    
    Class STEPCAFControl_Writer is corrected to avoid replacing non-Ascii symbols by question marks, and spaces by underscores, on export to STEP.
    
    Related: DRAW commands dealing with strings in OCAF documents are corrected to pass Unicode symbols as UTF-8.
    
    Off-topic: code saving names of external STEP files in XDE and fetching them back is corrected to preserve Unicode symbols as UTF-8.
    
    Added test bugs xde bug31851
    
    Test de step_4 E7 corrected (no more replacement of spaces by underscores in names of layers)

abv

2020-10-14 15:39

manager   ~0095977

Fix is pushed to branch CR31851 and tested; see Jenkins job CR31851-abv; please review

gka

2020-10-14 15:42

developer   ~0095978

Branch CR31851_1 was reviewed

bugmaster

2020-10-17 13:22

administrator   ~0096035

Combination -
OCCT branch : IR-2020-10-16
master SHA - ae9f4b64cacf0df612944b3694a3bdfa5f1f29cf
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-10-16 SHA - fcb5abe005e152f7f923f4cf6c02acb07c027cdc
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 18027.820000000127 / 18057.130000000117 [-0.16%]
Products
Total CPU difference: 12174.330000000093 / 12182.170000000115 [-0.06%]
Windows-64-VC14:
OCCT
Total CPU difference: 19740.03125 / 19746.828125 [-0.03%]
Products
Total CPU difference: 13564.71875 / 13586.625 [-0.16%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2020-10-24 12:41

administrator   ~0096222

Branch CR31851_1 has been deleted by inv.

SHA-1: 5847fc2de29ea225f646b7ed84a924315655e846

git

2020-10-24 12:41

administrator   ~0096223

Branch CR31851 has been deleted by inv.

SHA-1: a453c85574f19fa2f3b337bcbff3ce109de0a34b

Related Changesets

occt: master ae9f4b64

2020-10-14 06:14:04

abv


Committer: bugmaster Details Diff
0031851: Data Exchange, STEP - enable Unicode symbols in STEP export

Class STEPCAFControl_Writer is corrected to avoid replacing non-Ascii symbols by question marks, and spaces by underscores, on export to STEP.

Related: DRAW commands dealing with strings in OCAF documents are corrected to pass Unicode symbols as UTF-8.

Off-topic: code saving names of external STEP files in XDE and fetching them back is corrected to preserve Unicode symbols as UTF-8.

Added test bugs xde bug31851

Test de step_4 E7 corrected (no more replacement of spaces by underscores in names of layers)
Affected Issues
0031851
mod - src/DDataStd/DDataStd_BasicCommands.cxx Diff File
mod - src/DDataStd/DDataStd_NameCommands.cxx Diff File
mod - src/DDataStd/DDataStd_TreeBrowser.cxx Diff File
mod - src/DDF/DDF_Browser.cxx Diff File
mod - src/DDocStd/DDocStd_ApplicationCommands.cxx Diff File
mod - src/DDocStd/DDocStd_DocumentCommands.cxx Diff File
mod - src/DDocStd/DDocStd_MTMCommands.cxx Diff File
mod - src/STEPCAFControl/STEPCAFControl_Writer.cxx Diff File
mod - src/XCAFDoc/XCAFDoc_ShapeTool.cxx Diff File
mod - src/XDEDRAW/XDEDRAW.cxx Diff File
mod - src/XDEDRAW/XDEDRAW_Layers.cxx Diff File
mod - src/XDEDRAW/XDEDRAW_Props.cxx Diff File
add - tests/bugs/xde/bug31851 Diff File
mod - tests/de/step_4/E7 Diff File

Issue History

Date Modified Username Field Change
2020-10-14 08:53 abv New Issue
2020-10-14 08:53 abv Assigned To => gka
2020-10-14 08:53 abv File Added: utf8.stp
2020-10-14 08:54 abv Assigned To gka => abv
2020-10-14 08:54 abv Target Version 7.6.0 => 7.5.0
2020-10-14 08:54 abv Relationship added related to 0028454
2020-10-14 08:56 abv Additional Information Updated
2020-10-14 09:11 git Note Added: 0095946
2020-10-14 09:14 kgv Steps to Reproduce Updated
2020-10-14 09:31 kgv Relationship added child of 0022484
2020-10-14 09:46 kgv Note Added: 0095950
2020-10-14 10:00 git Note Added: 0095953
2020-10-14 12:14 kgv Severity minor => feature
2020-10-14 12:16 git Note Added: 0095957
2020-10-14 12:18 git Note Added: 0095958
2020-10-14 15:39 abv Note Added: 0095977
2020-10-14 15:39 abv Assigned To abv => gka
2020-10-14 15:39 abv Status new => resolved
2020-10-14 15:42 gka Note Added: 0095978
2020-10-14 15:42 gka Assigned To gka => bugmaster
2020-10-14 15:42 gka Status resolved => reviewed
2020-10-17 13:22 bugmaster Note Added: 0096035
2020-10-17 13:22 bugmaster Status reviewed => tested
2020-10-17 13:31 bugmaster Test case number => bugs/xde/bug31851
2020-10-17 13:31 bugmaster Changeset attached => occt master ae9f4b64
2020-10-17 13:31 bugmaster Status tested => verified
2020-10-17 13:31 bugmaster Resolution open => fixed
2020-10-24 12:41 git Note Added: 0096222
2020-10-24 12:41 git Note Added: 0096223
2020-10-25 20:41 abv Relationship added has duplicate 0031182
2020-12-02 16:22 emo Fixed in Version => 7.5.0
2020-12-02 17:13 emo Status verified => closed