I am writing a console program that processes files passed by the user as launch arguments (reads, processes in a certain way, writes to other files). The problem is that file paths can contain chinese, german, ukrainian and other non-standard letters, which are incorrectly processed by the program (impossible to open files due to an incorrect path). I can use 'wmain' and 'wchar_t** argv' instead of 'main' and 'char** argv', but I haven't seen any library for argument parsing that supports wchar_t argv, and I, besides paths, have to parse many more parameters of different types.
Tell me, please:
- Is it possible to get by with exclusively ordinary char when processing paths containing non-ascii characters?
- Do you know any argument parsing libraries that support 'wmain'? (most popular, 'argparse', doesn`t support it.)
strcmp(),strlen(), and such? Don'twcscmp(),wcslen()and related (in<wchar.h>, or<cwchar>in C++) work for you?char-based libraries if you properly configure locale in your program, but YMMV. Finally, with a simple Google, I found about a version ofgetoptthat was ported to Unicode (codeproject.com/Articles/157001/…) Would that work for you?boost::program_optionssupportwchar_t. Googling "wchar_t getopt" returns quite a bit of results too.