all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Benjamin Riefenstahl <Benjamin.Riefenstahl@epost.de>
Subject: Re: shell-quote-argument and multibyte
Date: 17 Apr 2003 15:54:07 +0200	[thread overview]
Message-ID: <m31y019qm8.fsf@cicero.benny.turtle-trading.net> (raw)
In-Reply-To: <200304151316.WAA24268@etlken.m17n.org>

Hi,


Kenichi Handa <handa@m17n.org> writes:
> By default, process arguements (including the filename in the above
> case) are encoded by:
>     (cdr default-process-coding-system)
> And usually, it is the same as default-file-name-coding-system.
> 
> So, if it doesn't work, it means that something is wrong in setting
> up coding systems on Windows.

Thanks for the clarification. 

> And, [encode-coding-string] shouldn't be done in
> shell-quote-argument.  Such an encoding should be done only for file
> names.

I understood that file names were the actual concern of the OP.  But
you are right, the encoding should probably be done outside of
shell-quote-argument.

Still the connections are not entirely clear to me.  I routinely
configure tools so that they output UTF-8, so the coding system for
I/O should be UTF-8.  But that doesn't change the fact that the file
name encoding is latin-1.

Commands like shell-quote-argument, call-process or
shell-command-to-string don't know which of their arguments are file
names.  While most of the command line arguments that are not file
names will not have non-ASCII characters (options), there are of
course arguments that are free text, like e.g. CVS log messages or
verbatim scripts.

That does mean that, to do the right thing, I will currently have to
encode the file names myself, right?  Like e.g. in this fragment,
which I use for reading Word documents with an external tool:

      (let ((coding-system-for-read 'utf-8)
	    (filename (encode-coding-string
		       buffer-file-name
		       (or file-name-coding-system
			   default-file-name-coding-system))))
	(call-process "antiword" nil t nil "-m" "UTF-8.txt"
		      filename))

Or is there a way to simplify this kind of thing?


so long, benny

  parent reply	other threads:[~2003-04-17 13:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-13 20:28 shell-quote-argument and multibyte Lars Hansen
2003-04-13 21:57 ` Benjamin Riefenstahl
2003-04-13 22:02 ` Benjamin Riefenstahl
2003-04-15 13:16   ` Kenichi Handa
2003-04-15 17:52     ` Lars Hansen
2003-04-16  2:00       ` Kenichi Handa
2003-04-16  6:16         ` Lars Hansen
2003-04-16  6:28           ` Kenichi Handa
2003-04-17 13:54     ` Benjamin Riefenstahl [this message]
2003-04-17 19:35       ` Kai Großjohann
2003-04-18 12:14         ` Benjamin Riefenstahl
2003-04-18 15:35           ` Kai Großjohann
  -- strict thread matches above, loose matches on Subject: below --
2003-05-11 17:51 Lars Hansen

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=m31y019qm8.fsf@cicero.benny.turtle-trading.net \
    --to=benjamin.riefenstahl@epost.de \
    /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.