I think I got it this time. I realized that ::open and ::stat work just fine with multibyte paths on windows so there's no need to change this code. The only problem is llvm::sys::fs module which falsely assumes that input strings are UTF8 encoded when they are in fact multibyte strings.<div>

<br></div><div>Now I really hope I haven't broken anything because llvm::sys::fs::exists is called in a number of places, but I'm guessing that none of the paths that are passed to it are really UTF8?</div><div><br>

</div><div>I think entire llvm::sys::fs module should be changed to use MultibyteToUTF16 instead of UTF8ToUTF16 before calling windows api functions (unless somebody knows that we actually have UTF8 paths on windows somewhere in the code)?</div>