all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Shigeru Fukaya <shigeru.fukaya@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 13589@debbugs.gnu.org
Subject: bug#13589: 24.2.92; wrongly escaped call-process arguments
Date: Fri, 01 Feb 2013 13:50:13 +0900	[thread overview]
Message-ID: <B3CE00379EFEA7shigeru.fukaya@gmail.com> (raw)
In-Reply-To: <83wquuh7xz.fsf@gnu.org>

Thank you for your reply.

Why I used CharNextExA is I can't find such functions for encoded
strings in Emacs.  Possible alternative is to change the quoting
process out of binary to elisp code.  Or provide some hook for it?

And, anyway, could you please initialize 'escape_char', so that we can
safely set `w32-quote-process-args' to nil and do some quoting by
ourselves (using advise or something).

Shigeru

>> From: Shigeru Fukaya <shigeru.fukaya@gmail.com>
>> Date: Thu, 31 Jan 2013 01:36:35 +0900
>> 
>> `call-process' wrongly treats those multibyte characters whose
>> 2nd byte is 0x5c.
>> It is bacause sys_spawnve in w32proc.c does bad quoting process.
>> 
>> Bad example:
>> 
>> (let ((coding-system-for-write 'cp932))
>>   (call-process "sh" nil t nil "-c" "ls d:/tmp/表*"))
>> ls: cannot access d:/tmp/表*: No such file or directory
>> 2
>> 
>> Correct example:
>> 
>> (let ((coding-system-for-write 'cp932))
>>   (call-process "sh" nil t nil "-c" "ls d:/tmp/表*"))
>> d:/tmp/表
>> d:/tmp/表1
>> 
>> d:/tmp/表表:
>> abc
>> 0
>> 
>> I tried fixing it (after w32.c as a reference).
>> Additionally, I set uninitialized `escape_char' to 0.
>
>Thanks for the report and the patch.
>
>Unfortunately, I don't think the solution you suggest is the right
>one.  It is one thing to support only Windows codepages in encoding of
>file names, as w32.c does: after all, that's the limitation of the OS
>APIs we use.  But imposing the same limitation for encoding
>command-line arguments to subprocesses is something entirely
>different.  E.g., consider such trivial example as invoking a speller:
>the encoding used to pass non-ASCII characters on the command line in
>this case might have nothing at all to do with Windows codepages.  We
>can no longer justify not supporting shift_jis in this case, for
>example.  IOW, using CharNextExA here would impose an unreasonably bad
>restriction on how subprocesses can be invoked from Emacs.
>
>In addition, without also fixing cmdproxy, which does similar things,
>this is not going to solve the problem, except in a few select cases.
>E.g., I think it's enough for you to use shell-file-name instead of
>"sh" to have the command be handed to cmdproxy by default, and then
>you'll have the same problem there.
>
>We need a better, less restricted and more thorough solution.  I don't
>yet know which one.
>
>Thanks.





  reply	other threads:[~2013-02-01  4:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-30 16:36 bug#13589: 24.2.92; wrongly escaped call-process arguments Shigeru Fukaya
2013-01-30 17:55 ` Eli Zaretskii
2013-02-01  4:50   ` Shigeru Fukaya [this message]
2013-02-01 10:12     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=B3CE00379EFEA7shigeru.fukaya@gmail.com \
    --to=shigeru.fukaya@gmail.com \
    --cc=13589@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.