Hacker News new | past | comments | ask | show | jobs | submit login

> Alternatively you can set the process code page to UTF-8 and call the 'A' variant API directly, but only sometimes, and only with Windows 10 v1903+, and you might still have to change the system locale setting and reboot

There is no need to do this; you can just call the A variant by name. Wide char and ascii functions are distinguished with W or A at the end, such as CreateFileA or CreateFileW. CreateFile is a macro.




I always directly call the A or W versions of these functions. It makes things unambigious.

Additionally I have my own Windows header file which undefines all of the macros so my function names do not get mangled with A and W suffixes.


It really caught me by surprise. Sure, I'm not a dev but in my mind A variant was for 9x compatibility.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: