For my application, UTF8ToWinCP, WinCPToUTF8 solved most of the problems, since they cover reading/writing strings correctly on Windows.
Now I'd need to refine the logic, translating - for instance - the UTF8 string 'è' (UTF8ToWinCP('è') correctly outputs 'è') to 'U+00E8', that is the literal I must use for a regex match issued by a VBS script.
I managed to perform such translations directly, hardcoding some patterns, but I'd like to play a bit more generally.
Have tried to read the source code of UTF8ToWinCP, and found that it's a fancy interface to the Windows API WideCharToMultiByte, so not really useful here. I could be missing something, of course.
I'm a bit lost in the many helper functions... I could extend the hardcoded patterns scraping the table (from
https://www.utf8-chartable.de/, for instance) and performing a lookup of the output of UTF8ToWinCP, but I hope there is something more direct available.
Thanks, Carlo