UTF-8 to UTF-16 APIs for Windows?

Is there any shell library that mimics the names of the "ANSI" Windows functions (for example, CreateFileA ), assumes the inputs are in UTF-8, converts them to UTF-16, calls the version of UTF-16 (for example, CreateFileW ) and converts the outputs back to UTF-8 for the program?

This will allow ASCII programs to use UTF-8 with virtually no problems.

+7
source share
3 answers

Instead of wrapping API functions, it is easier to wrap strings in conversion functions. Then you will be confident in the future when additional API functions are added in the next version of Windows.

+2
source

This thing is called WDL , it has some UTF-8 wrappers (win32_utf8). I have never tried, so I do not know how full support is.

0
source

As others have said, there are too many WinAPI functions to make such a library executable. However, you can hack it at the toolchain level or use something like http://research.microsoft.com/en-us/projects/detours/ .

0
source

All Articles