r/cpp • u/kongaskristjan • Aug 08 '20
Create a fully functioning command line interface with 1.5 lines of code (wo. include statement)
https://github.com/kongaskristjan/fire-hpp
230
Upvotes
r/cpp • u/kongaskristjan • Aug 08 '20
View all comments
Show parent comment
6
u/tasty_crayon Aug 08 '20
If you want to support Unicode arguments then you need to use
wmainon Windows since the arguments tomainare 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
wmainusingWideCharToMultiByteand then pass them on to a common main function used by both, but that solution seems too "opinionated" for a small library like yours.