Piotr Caban (@piotr) commented about dlls/msvcrt/locale.c:
locinfo->ctype1[0] = 0; locinfo->pctype = locinfo->ctype1+1;
cp_lcid = lcid_from_codepage(locinfo->lc_codepage);
This will not work for codepages that don't have lcid that uses them as default ansi code page (e.g. 437). I think that the correct approach is to use MultiByteToWideChar/LCMapStringW/WideCharToMultiByte instead.