> Date: Tue, 08 May 2012 23:23:02 -0700 > From: Paul Eggert <[email protected]> > CC: [email protected], [email protected] > > On 05/08/2012 10:46 PM, Eli Zaretskii wrote: > > Can you be more specific in your question? Are you asking whether any > > byte stream is allowed in the command-line arguments? > > The basic idea is that we're trying to emulate a function > like execvp, which takes an array of C strings and which > does not care about encoding. On a host that doesn't have > fork+execvp we are taking the array and quoting it suitably > for popen or for system. In POSIX this cannot be done > portably, since the arguments to popen/system must be encoded > suitably for the current locale (typically UTF-8 these days) > and encoding errors are not allowed. Presumably the code will just > put the bytes into the string and hope for the best; often > in POSIXish environments it will work despite the encoding > error. > > My assumption is that Windows is similar.
Yes, Windows is similar, except that you can use separate APIs that accept UTF-16 wide characters, which then lets you pass strings unlimited by the current locale.
