emacs-devel
[Top][All Lists]
Advanced

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

Re: Codepages and shell function on w32


From: Lennart Borgman (gmail)
Subject: Re: Codepages and shell function on w32
Date: Mon, 01 Jan 2007 14:46:13 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

Eli Zaretskii wrote:
Date: Mon, 01 Jan 2007 04:05:23 +0100
From: "Lennart Borgman (gmail)" <address@hidden>
CC:  address@hidden

Eli Zaretskii wrote:
Date: Sun, 31 Dec 2006 14:22:09 +0100
From: "Lennart Borgman (gmail)" <address@hidden>

              (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.

Thanks. Should the cmdproxy case look something like this then:

       (let ((shell-file-name prog)
             (proc (get-buffer-process (current-buffer)))
             (fullprog (executable-find prog))
             (cp-out
              (coding-system-change-eol-conversion
               (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))

Should it be in defun shell? Is there a better way then (read (format ...)) to convert from integer to symbol here?

It's very easy to verify, if you have Cygwin programs installed, no?

Yes, both Cygwin and MSYS for testing.

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.

Both MSYS and Cygwin have troubles with Swedish characters in file names.





reply via email to

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