Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I share your recommendations of always using PWSTR when using windows apis.

> I'm not sure why the non-unicode APIs are still so commonly used

I think because the rest of the C world uses char* with utf-8, so that is what people are habituated to. Setting the ACP to CP_UTF8 would have solved a lot of problems, but I believe that's only been supported for a short period of time, bafflingly.



> Setting the ACP to CP_UTF8 would have solved a lot of problems, but I believe that's only been supported for a short period of time, bafflingly.

It wouldn't solve all encoding problems though because most Windows APIs can store/return invalid UTF-16 which you can't represent in CP_UTF8 - you'd need a CP_WTF8 for that which doesn't even exist so you have to use the W APIs and do the conversion yourself.




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

Search: