Skip to content

Commit

Permalink
Import: fixes FreeCAD#10983: Crash when trying to import a DXF file w…
Browse files Browse the repository at this point in the history
…ith Polish letters in the name
  • Loading branch information
wwmayer committed Oct 10, 2023
1 parent 191aee5 commit 057469c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Mod/Import/App/dxf/dxf.cpp
Expand Up @@ -1809,17 +1809,18 @@ CDxfRead::CDxfRead(const char* filepath)
memset(m_block_name, '\0', sizeof(m_block_name));
m_ignore_errors = true;

m_ifs = new ifstream(filepath);
m_version = RUnknown;
m_CodePage = nullptr;
m_encoding = nullptr;

m_ifs = new Base::ifstream(Base::FileInfo(filepath));
if (!(*m_ifs)) {
m_fail = true;
printf("DXF file didn't load\n");
return;
}
m_ifs->imbue(std::locale("C"));

m_version = RUnknown;
m_CodePage = nullptr;
m_encoding = nullptr;
stringToUTF8 = &CDxfRead::UTF8ToUTF8;
}

Expand Down

0 comments on commit 057469c

Please sign in to comment.