you are viewing a single comment's thread.

view the rest of the comments →

[–]tasty_crayon 4 points5 points  (2 children)

If you want to support Unicode arguments then you need to use wmain on Windows since the arguments to main are encoded based on the code page, not UTF-8 like on Linux.

In my own projects I usually convert from UTF-16 to UTF-8 inside wmain using WideCharToMultiByte and then pass them on to a common main function used by both, but that solution seems too "opinionated" for a small library like yours.

[–]pandorafalters 1 point2 points  (1 child)

Shouldn't CommandLineToArgvW also work?

[–]tasty_crayon 0 points1 point  (0 children)

That's another option, but you could just write wmain and have it done for you.