4 ms·
That fixes the problem, but goes in the wrong direction IMO. I argue that you actually should only use MessageBoxW, ignore all the macros, and just use wide str
by codeflo 3y ago
That fixes the problem, but goes in the wrong direction IMO. I argue that you actually should only use MessageBoxW, ignore all the macros, and just use wide strings whenever you interact with the OS. An Ansi-only program is broken in 2023, and actually has been for two decades.
- lmz 3y agoBut now you can use the ANSI functions to support UTF-8: https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page#-a-vs--w-apis https://learn.microsoft.com/en-us/windows/apps/design/global...
- account42 3y ago*terms and conditions apply If you are dealing with user-created files you should always use the *W functions as filenames are not guaranteed to be valid UTF-16 and thus might not be accessible via UTF-8 *A calls. At least until Microsoft adds WTF-8 [0] support to the *A functions. You can use WTF-8 yourself internally of course so no need for wide strings outside your platform abstraction code. [0] https://simonsapin.github.io/wtf-8/ https://simonsapin.github.io/wtf-8/
- projektfu 3y agoI agree, but we're also talking about Win95, which didn't support Unicode until 2001. The example compiles fine so long as UNICODE isn't defined but assuming, as a 90s dev, you'll eventually want to support NT when they make it run games, you should probably leave the door open with TCHAR.