For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

STEP FILE READER FOR FILE PATH WITH UMLAUT

Domi Schu's picture
Forums: 

Hello, i am using OCCT 7.4.0. Like in the examples described I implemented the step reader and everything works fine expecting someone is trying to read a step file with an German "umlaut" in the filename (or filepath).

My implementation:

STEPCAFControl_Reader stepReader;

stepReader.SetColorMode(true);

stepReader.SetNameMode(true);

stepReader.SetLayerMode(true);

auto status = stepReader.ReadFile("B:\\Projects\\CADFiles\\Cube_ä.STEP");

Do you have any ideas how to realize that import? Do you have any examples?

Thanks in advance,

Dominik

Attachments: 
Kirill Gavrilov's picture

Hard-coding non-ascii file paths into source code for test such issue is not a good idea, as string content will depend on compiler, compilation flags and cpp file encoding.
OCCT expectes file paths to be in UTF-8 encoding. WinAPI operates with wchar_t* paths, thus, make sure that your application performs necessary conversion.

const wchar_t* thePath;
TCollection_AsciiString anUtf8 (thePath);
aStepReader.ReadFile (anUtf8.ToCString());

 

Domi Schu's picture

Thank you very much, that works for me!

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.