[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Unwanted ^M in the output from shell-command-on-region
From: |
Kenichi Handa |
Subject: |
Re: Unwanted ^M in the output from shell-command-on-region |
Date: |
Wed, 17 May 2006 10:33:16 +0900 |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
In article <address@hidden>, Lennart Borgman <address@hidden> writes:
> This is a problem on w32, but might be more general. I can not
> understand how to get rid of ^M from the output of the program Tidy when
> I run it with `shell-command-on-region' (or in other ways). From the
> documentation it looks like `coding-system-for-read' or
> `coding-system-for-write' should be used, but setting them does not
> remove ^M.
> I have made an example below. It uses the program Tidy from
> http://tidy.sourceforge.net/trt/tidy_win32.zip. (Tidy is a program for
> (X)HTML curing.)
I made this HTML file (with dos coding system):
--- temp.html ---
<html>
<head>
</head>
</html>
-----------------
and run Tidy.exe as this in Cygwin terminal.
% Tidy.exe < temp.html 2>&1 | od -c
Then the output was like this:
0000000 l i n e 1 c o l u m n 1
0000020 - W a r n i n g : m i s s i
0000040 n g < ! D O C T Y P E > d e
0000060 c l a r a t i o n \r \r \n l i n e
0000100 4 c o l u m n 1 - W a
0000120 r n i n g : d i s c a r d i n
0000140 g u n e x p e c t e d < / h
0000160 t m l > \r \r \n l i n e 2 c o
As you see, the output contains \r\r\n sequence. But,
undecided-dos docodes only the \r\n sequnce into \n. That's
why you see the remaining \r.
So, it seems that it is the problem of Tidy.exe.
---
Kenichi Handa
address@hidden