Subject: Re: bug#8531: 24.0.50; shell-quote-argument shouldn't escape special characters

From: Thierry Volpiatto <[email-masked]>
Date: Thu, 21 Apr 2011 15:31:41 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Thierry Volpiatto <[email-masked]>
>> Date: Thu, 21 Apr 2011 14:10:49 +0200
>> 
>> > I have no problem with using the
>> > result of shell-quote-argument in "M-!".
>> Which result?
>> Which command?
>
> The command was "ls Vid\éos".  It displayed the files in that
> directory.
Yes, but ls "Vid\éos" fail.

The point is being able to do something like this:
(shell-command (format "ls %s" (shell-quote-argument (read-string "Fname: "))))

instead of e.g
(shell-command (format "ls '%s'" (read-string "Fname: ")))

>> I am speaking of escaping accentued characters "é, à etc..."
>
> Yes, so am I.
Ok.
>> Why `shell-quote-argument' escape such characters?
>
> Because it wants to play safe.  In a Posix shell, any non-special
> character preceded with a backslash stands for itself, I'm sure you
> know that.  Backslash-escaping anything that is not in the Posix
> character set avoids too much knowledge about the underlying shell's
> special characters, and should be harmless if the escaped characters
> are not special.
Oh yes, i remember now that "é etc.." are not in posix character set,
thanks.

-- 
A+ Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997