Probably you're running into the OEM vs. ANSI code pages. Just using Unicode completely eliminates that problem! There are two versions of the Windows API entry points: The -A form maps the 8-bit string based on current settings. The -W form takes a 16-bit string and doesn't mess with it.