From: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Codepages and shell function on w32
Date: Mon, 01 Jan 2007 00:49:42 -0500 [thread overview]
Message-ID: <E1H1G3K-0008Mc-05@fencepost.gnu.org> (raw)
In-Reply-To: <45987A73.6040702@gmail.com> (lennart.borgman@gmail.com)
> Date: Mon, 01 Jan 2007 04:05:23 +0100
> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> CC: emacs-devel@gnu.org
>
> Eli Zaretskii wrote:
> >> Date: Sun, 31 Dec 2006 14:22:09 +0100
> >> From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
> >>
> >> (cp-out (read (format "cp%s" (w32-get-console-output-codepage))))
> >> (cp-in (read (format "cp%s" (w32-get-console-codepage)))))
> >> (cond
> >> ((w32-shell-dos-semantics)
> >> (set-process-coding-system proc cp-out cp-in))
> >>
> >
> > This is wrong: w32-fns.el sets this as follows:
> >
> > (setq default-process-coding-system
> > (if default-enable-multibyte-characters
> > '(undecided-dos . undecided-unix)
> > '(raw-text-dos . raw-text-unix)))
> >
> > The output encoding uses *-unix for a good reason.
>
> Can you please explain a bit more? How should it look?
I meant the EOL conversion that you've left unspecified (i.e. open to
Emacs guesswork on input and subtle black magic on output). You need
to use coding-system-change-eol-conversion to force the car of the
cons cell use -dos, and the cdr to use -unix. (I hope this answers
your question because, frankly, I'm not quite sure what you were
asking.)
> In the case
> cmdproxy case (the case above) it works for me with this code using
> Swedish characters in file names for example.
``Works for me'' is not a replacement for good engineering, because
your testing can never find all problems. We use these specific EOL
conversions for input and output because of the reason explained in
this comment in w32-fns.el:
;; Most programs on Windows will accept Unix line endings on input
;; (and some programs ported from Unix require it) but most will
;; produce DOS line endings on output.
> > Does Cygwin at all support anything beyond the C locale? If not,
> > that's the reason why windows-1252 doesn't work for you.
>
> I have no idea.
It's very easy to verify, if you have Cygwin programs installed, no?
> What do I write to test with the C locale?
I'd suggest the other way around: try to get a Cygwin program to work
correctly in a non-C locale. For example, `sort' should use the
correct sorting order with non-ASCII (Swedish) characters, `ls' should
display file names with correct Swedish characters, etc.
next prev parent reply other threads:[~2007-01-01 5:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-31 13:22 Codepages and shell function on w32 Lennart Borgman (gmail)
2006-12-31 22:04 ` Eli Zaretskii
2007-01-01 3:05 ` Lennart Borgman (gmail)
2007-01-01 5:49 ` Eli Zaretskii [this message]
2007-01-01 13:46 ` Lennart Borgman (gmail)
2007-01-01 6:08 ` Jason Rumney
2007-01-01 7:27 ` Eli Zaretskii
2007-01-01 14:20 ` Lennart Borgman (gmail)
2007-01-02 4:26 ` Eli Zaretskii
2007-01-02 15:39 ` Lennart Borgman (gmail)
2007-01-02 21:53 ` Benjamin Riefenstahl
2007-01-02 22:49 ` Lennart Borgman (gmail)
2007-01-06 0:47 ` Benjamin Riefenstahl
2007-01-06 1:55 ` Lennart Borgman (gmail)
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=E1H1G3K-0008Mc-05@fencepost.gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@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.