Reputation: 76519
Can I generate a 8.3 filename for a unicode filename and use that ASCII string of char's to open an fstream
in Windows?
I know that MSVC++ provides a wchar_t*
overload for fstream
, but GCC's libstdc++ does not provide this :(, so I need an alternative. I don't want to create my own streambuf class just for this, as it seems overkill.
Upvotes: 1
Views: 1122
Reputation: 476930
You can probably leverage the Windows API function GetShortPathName
to give you the short name. You cannot "compute" the name algorithmically as there is no one-to-one correspondence between an arbitrary long name and a short name, and I don't think you can avoid using the Windows API for the translation.
Upvotes: 3