[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new module 'system-quote'

From: Eli Zaretskii
Subject: Re: new module 'system-quote'
Date: Wed, 09 May 2012 20:32:22 +0300

> Date: Tue, 08 May 2012 23:23:02 -0700
> From: Paul Eggert <address@hidden>
> CC: address@hidden, address@hidden
> 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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]