]> OCCT Git - occt.git/commitdiff
0030397: Data Exchange - STEP Reader extension to support entities which have a text...
authordpasukhi <dpasukhi@opencascade.com>
Wed, 9 Sep 2020 10:02:39 +0000 (13:02 +0300)
committerabv <abv@opencascade.com>
Sat, 12 Sep 2020 17:42:19 +0000 (20:42 +0300)
STEP file is now opened in binary mode (instead of text mode) to avoid unexpected handling of control symbols inside string constants.

src/StepFile/stepread.c
tests/bugs/step/bug30397 [new file with mode: 0644]

index aeff1e918123c336f931b1070dabf99a2d8ca4b6..e0fd83b027b4fb03d7b1f3591ff4f31b8c7164be 100644 (file)
@@ -85,7 +85,7 @@ FILE* stepread_setinput (char* nomfic)
 {
   FILE* newin ;
   if (strlen(nomfic) == 0) return stepin ;
-  newin = OSD_OpenFile(nomfic,"r");
+  newin = OSD_OpenFile(nomfic,"rb");
 
   if (newin == NULL) {
     return NULL ;
diff --git a/tests/bugs/step/bug30397 b/tests/bugs/step/bug30397
new file mode 100644 (file)
index 0000000..ad1244c
--- /dev/null
@@ -0,0 +1,11 @@
+puts "========================"
+puts "0030397: Data Exchange - STEP Reader extension to support entities which have a text description field with not supported symbols"
+puts "========================"
+
+ReadStep D [locate_data_file bug31397.stp]
+
+set state [data c]
+
+if { [regexp "141153" $state] != 1 } {
+   puts "Error : wrong count of transferred roots"
+}
\ No newline at end of file