Got it working, thanks!
What I'm doing is this right before I use CreateFileW:
Code:
wchar_t dst[1000];
MultiByteToWideChar(CP_UTF8, 0, filePath, 1000, dst, 1000);
"filePath" is "char *filePath" in the function, which was declared as "char filePath[1000]" outside the function. I assume "wchar_t dst" doesn't need more than 1000 in length. Or does it need double (or half)?
First I try to open the file with CreateFileA, if that fails I try to open the file with CreateFileW. If I didn't do it like that I couldn't open file named like so: "åäö.jpg".
I don't really get why CreateFileW works with japanese characters and normal characters (a-z) but not with "å" or "ì" for example. CreateFileW works when the file name is "åäö日本語.jpg". I guess the DLL is being sent characters encoded differently?
Well, it works like it is now, by using both CreateFileA and CreateFileW. Always thought it was strange that Windows uses UTF16 and not UTF8 which I think look superior.
Thanks again gentlemen!
Edit: Sorry for my late reply, I have been busy and haven't checked for replies until just now.