STEP FILE READER FOR FILE PATH WITH UMLAUT

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());
dominik.schuster_156346's picture

Thank you very much, that works for me!