Just use setlocale(LC_ALL, &quot;&quot;) in main, and use mbrtowc to translate from whatever the system encoding is into the wchar_t type. There&#x27;s no need to bake assumptions about the system encoding into most programs.