-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Description
Nice library!
The ReadStlFile_ASCII, ReadStlFile_BINARY, and StlFileHasASCIIFormat functions all take const char* for the filename.
On windows this causes issues when opening filenames which contain Unicode (UTF-16) strings.
The issue is the ifstream(const char*) constructor, which on windows will only accept ascii strings.
Possible solutions/ideas:
- Templatize the function on
CharT - Overload the function on windows only with a version which takes a
const wchar_t*or possiblyconst char16_t*(this is the easiest to monkey-patch in lieu of a fix) - (C++17 only) Take a
std::filesystem::pathas an argument instead of aconst char*, which should do all the conversions for you and just do the right thing on all platforms. Would be backwards compatible, sinceconst char*converts to apathimplicitly. - Have the function take an arbitrary
istreaminstead of requiring filenames (would support e.g. piping easier this way I guess)
Metadata
Metadata
Assignees
Labels
No labels