Closed jazzbre closed 6 years ago
Actually the right way to do this is this it seems:
wstring wfileName = info.FileName[0 .. info.FileNameLength / 2].idup; string fileName = wfileName.toUTF8.idup;
hm that should be the same as the one up there actually. Can you try using the original code making it a void*
instead of ubyte*
?
Hm, reverted the code but it doesn't happen anymore, it's possible it was some other code that save the files wrong. I will investigate this further.
Had to replace:
string fileName = (cast(wchar[])(cast(ubyte*) info.FileName)[0 .. info.FileNameLength]).toUTF8.idup;
with:wstring wfileName = info.FileName[0 .. info.FileNameLength].idup; string fileName = wfileName.toUTF8.idup;
(BTW Formatting got broken on paste).