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

You also have to use wmain instead of main, with a wchar_t argv, otherwise the compiled-in argparser will be calling the ANSI version. In other words... Anyone using MSVC and the cross-platform standardised and normal C system, are hit by this.

Oh, and wmain is a VisualC thing. It isn't found on other platforms. Not standardised.



Writing cross platform code which consistently uses UCS-2 wchar_t* on Windows and UTF-8 char* on UNIX-like systems sounds like absolute hell


It's not that bad really - you just convert at the win32 API call boundary.

Also, it's not UCS-2. Also not UTF-16. Windows uses WTF-16 internally and if you want 100% compatibility that's what you need to target.


A wchar_t "native" libc implementation would be an interesting thing.




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

Search: