View Issue Details

IDProjectCategoryView StatusLast Update
0029069CommunityOCCT:Samplespublic2018-06-29 21:19
Reportersgiesel Assigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformPCOSWindows 7 
Product Version7.1.0 
Target Version7.3.0Fixed in Version7.3.0 
Summary0029069: Samples - handle UNICODE filenames within C++/CLI CSharp sample
DescriptionWhen loading a step file with special characters like ä,Ü,á,... OpenCascade will return with a failure.
Steps To Reproduce1. Rename a step file to for example Inválid.step
2. Try to open it with the STEPCAFControl_Reader::Perform() with the path to the invalid stepfile
3. It always returns false
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0027585 closedapn Community It is not possible to store OCAF documents to paths with special characters in their names 
child of 0022484 closedbugmaster Open CASCADE UNICODE characters support. 

Activities

abv

2017-10-09 10:04

manager   ~0071290

I cannot reproduce the problem with the file named "InválidäÜá.stp": the file gets opened correctly in Import Export sample (both MFC or Qt) in OCCT 7.1.0 (as well as 7.0.0 and 7.2.0). The problem may occur with some other symbols in 7.1.0 -- this is known issue 0027585, fixed in OCCT 7.2.0.

Please check if the problem is resolved in OCCT 7.2.0.

If the problem still persists, please describe more precisely how to reproduce it.

sgiesel

2017-10-13 08:55

reporter   ~0071390

It seems like the error only occurs when you wrap OCCT into a C#-Layer.
Most likely because the string is interpreted as another charset.

If you use ASCII-Charset instaed of Unicode the error stills exists in the 7.1-branch

Here a minimal running example:
#include "TCollection_AsciiString.hxx"

#include "TDocStd_Document.hxx"
#include "XCAFApp_Application.hxx"
#include "STEPCAFControl_Reader.hxx"
#include <iostream>

using namespace std;
using namespace opencascade;
int main(int argc, const char* argv[]) {

    auto filename = "C://temp//Inválid.step"; // <-- If you're using a wchar_t no error will be thrown

    auto format = TCollection_ExtendedString("MDTV-XCAF");
    auto stepDocument = TDocStd_Document(format);
    auto docHandle = handle<TDocStd_Document>(&stepDocument);
    auto app = XCAFApp_Application::GetApplication();
    app->NewDocument(format, docHandle);
    auto stepReader = STEPCAFControl_Reader();
    auto result = stepReader.Perform(filename, docHandle);
    if (result != true)
    {
        cout << "Error.";
        stepReader.Reader().PrintCheckLoad(false,
            IFSelect_PrintCount::IFSelect_GeneralInfo);
    }
    else
    {
        cout << "No Error!";
    }

    return 0;
}

So it seems like that without any additional wrapping-metadata the C#-Wrapper will use the ASCII-Method and fail.

abv

2017-10-13 13:11

manager   ~0071410

When wrapping to C# is concerned, Unicode strings can be passed correctly to C# level, but the way to do that depends on method used for the wrapping.

So should I consider the issue as resolved and close it?

abv

2017-10-13 13:18

manager   ~0071411

Oops, I see: it does not work in C# samples in OCCT 7.1 or 7.2

git

2018-01-29 11:14

administrator   ~0073640

Branch CR29069 has been created by kgv.

SHA-1: f01a0f38fb04474aa1204efb9da9937b2ab9e445


Detailed log of new commits:

Author: kgv
Date: Mon Jan 29 11:05:20 2018 +0300

    0029069: Samples - handle UNICODE filenames within C++/CLI CSharp sample

kgv

2018-01-29 11:57

developer   ~0073642

Patch is ready for review.

http://jenkins-test-10.nnov.opencascade.com/view/CR29069-master-KGV/

git

2018-01-31 11:25

administrator   ~0073692

Branch CR29069_1 has been created by kgv.

SHA-1: 08584c5516e98e995efb2ad8d415105b5e7fa6a7


Detailed log of new commits:

Author: kgv
Date: Mon Jan 29 11:05:20 2018 +0300

    0029069: Samples - handle UNICODE filenames within C++/CLI CSharp sample

abv

2018-01-31 11:34

manager   ~0073693

No remarks, please integrate

apn

2018-01-31 13:26

administrator   ~0073696

Combination -
OCCT branch : CR29069_1 SHA - 08584c5516e98e995efb2ad8d415105b5e7fa6a7
Products branch : master SHA - 9d16afb77be76e276e46b7b3fc08eb16a4eea45e
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

git

2018-02-05 11:39

administrator   ~0073765

Branch CR29069 has been deleted by kgv.

SHA-1: f01a0f38fb04474aa1204efb9da9937b2ab9e445

git

2018-02-05 11:39

administrator   ~0073766

Branch CR29069_1 has been deleted by kgv.

SHA-1: 08584c5516e98e995efb2ad8d415105b5e7fa6a7

Related Changesets

occt: master 95f68826

2018-01-29 08:05:20

kgv


Committer: apn Details Diff
0029069: Samples - handle UNICODE filenames within C++/CLI CSharp sample Affected Issues
0029069
mod - samples/CSharp/OCCTProxy/OCCTProxy.cpp Diff File
mod - samples/CSharp/OCCTProxy_D3D/OCCTProxyD3D.cpp Diff File

Issue History

Date Modified Username Field Change
2017-08-31 15:43 sgiesel New Issue
2017-08-31 15:43 sgiesel Assigned To => gka
2017-10-09 09:53 abv Relationship added duplicate of 0027585
2017-10-09 10:04 abv Note Added: 0071290
2017-10-09 10:04 abv Assigned To gka => sgiesel
2017-10-09 10:04 abv Status new => feedback
2017-10-13 08:55 sgiesel Note Added: 0071390
2017-10-13 13:11 abv Note Added: 0071410
2017-10-13 13:18 abv Note Added: 0071411
2017-10-13 13:18 abv Assigned To sgiesel => apn
2017-10-13 13:18 abv Status feedback => assigned
2017-10-13 13:18 abv Category OCCT:Data Exchange => OCCT:Samples
2017-10-13 13:18 abv Target Version => 7.3.0
2018-01-29 10:44 kgv File Added: occ_wpf_sample.png
2018-01-29 11:03 kgv Severity crash => minor
2018-01-29 11:03 kgv Summary OpenCascase can't load step-files with some special characters => Samples - handle UNICODE filenames within C++/CLI CSharp sample
2018-01-29 11:14 git Note Added: 0073640
2018-01-29 11:17 kgv Relationship replaced related to 0027585
2018-01-29 11:18 kgv Relationship added child of 0022484
2018-01-29 11:57 kgv Note Added: 0073642
2018-01-29 11:57 kgv Assigned To apn => abv
2018-01-29 11:57 kgv Status assigned => resolved
2018-01-29 11:57 kgv Additional Information Updated
2018-01-29 11:58 kgv File Deleted: occ_wpf_sample.png
2018-01-31 11:25 git Note Added: 0073692
2018-01-31 11:34 abv Note Added: 0073693
2018-01-31 11:34 abv Assigned To abv => bugmaster
2018-01-31 11:34 abv Status resolved => reviewed
2018-01-31 13:26 apn Test case number => Not needed
2018-01-31 13:26 apn Note Added: 0073696
2018-01-31 13:26 apn Status reviewed => tested
2018-02-03 18:59 apn Changeset attached => occt master 95f68826
2018-02-03 18:59 apn Assigned To bugmaster => apn
2018-02-03 18:59 apn Status tested => verified
2018-02-03 18:59 apn Resolution open => fixed
2018-02-05 11:39 git Note Added: 0073765
2018-02-05 11:39 git Note Added: 0073766
2018-06-29 21:15 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed