Widescreen for C / C ++

Is there a wchar_t version of exec[lv][pe] (ie exec that uses wchar_t as a path and wchar_t as arguments)? On Windows I can just do CreateProcessW(process, cmdline) , but on *nix I am stuck (i.e. There is no pure POSIX equivalent). I am trying to add UTF-16 support to my program (autostart).

+4
source share
2 answers

No. UNIX typically uses UTF-8 when interacting with its environment.

+4
source

There is a problem: the UNIX / Linux file system encodes agnostic. All file names are just a bunch of bytes.

So, if I do LANG = ja_JAP.EUC_JP, create a file with a Japanese name, then I will do LANG = ja_JP.UTF8, when I look at my file name, it will look like garbage, and this will be invalid UTF -8.

You could say: why? But imagine that you have a system used by hundreds of international users, each of which uses Russian / Chinese / Korean / Arabic files, and you need to write an application for backup: - (

The "solution" is to ask everyone to set the locale to something .UTF8, but this is just an agreement, the system itself does not provide anything.

+2
source

Source: https://habr.com/ru/post/1277267/


All Articles