Re: Best way to handle DOS newlines

2007-06-05 Thread Alain Bench
Hello Michelle,

 On Saturday, May 26, 2007 at 15:06:43 +0200, Michelle Konzack wrote:

 But it seems, your MTA/MUA has eaten the backslashrbackslashn
 It should be [...] \r\n

Alex has no problem. The thing eating certain characters is on your
incoming path, Michelle.


Bye!Alain.
-- 
Mutt muttrc tip to send mails in best adapted first necessary and sufficient
charset (version for East Europe Latin-2/CP-852/CP-1250 terminal users):
set 
send_charset=us-ascii:iso-8859-1:iso-8859-15:windows-1252:iso-8859-2:windows-1250:utf-8


Re: Best way to handle DOS newlines

2007-06-05 Thread Wilkinson, Alex
0n Tue, Jun 05, 2007 at 12:34:52AM +0200, Alain Bench wrote: 

Hello Michelle,

 On Saturday, May 26, 2007 at 15:06:43 +0200, Michelle Konzack wrote:

 But it seems, your MTA/MUA has eaten the backslashrbackslashn
 It should be [...] \r\n

Alex has no problem. The thing eating certain characters is on your
incoming path, Michelle.

True, true.

 -aW

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.



Re: Best way to handle DOS newlines

2007-05-26 Thread Michelle Konzack
Am 2007-05-25 14:36:09, schrieb Wilkinson, Alex:
 0n Sat, May 12, 2007 at 12:54:20PM +0200, Michelle Konzack wrote: 
 
 
 # FLT_dos_coded
 
 :0 fw
 * ^1^ 
 
 * ? which dos2unix /dev/null 21
 |/usr/bin/dos2unix
 
 Michelle,
 
 Can you please interpret the following line in English for me:
 
* ^1^ 

This is calles procmail scoring technology and it returns true if
you have Dos-Linebreaks in the body of your message.

But it seems, your MTA/MUA has eaten the backslashrbackslashn

It should be

:0 fw
* ^1^ \r\n
* ? which dos2unix /dev/null 21
|/usr/bin/dos2unix

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: Best way to handle DOS newlines

2007-05-25 Thread Wilkinson, Alex
0n Sat, May 12, 2007 at 12:54:20PM +0200, Michelle Konzack wrote: 


# FLT_dos_coded

:0 fw
* ^1^ \r\n
* ? which dos2unix /dev/null 21
|/usr/bin/dos2unix

Michelle,

Can you please interpret the following line in English for me:

   * ^1^ \r\n

Cheers

 -aW



IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 
1914.  If you have received this email in error, you are requested to contact 
the sender and delete the email.



Re: Best way to handle DOS newlines

2007-05-12 Thread Michelle Konzack
Am 2007-05-07 17:59:43, schrieb Ray Van Dolson:
 I occasionally get emails generated from a web application here at work
 that uses DOS/Windows newlines instead of Unix ones.  All the text
 shows up as one large line interspersed with ^M^M's.  I'd like to
 figure out a good way to:
 
   1. Correct this in the pager view of the message.
   2. Correct this prior to the message being passed to my editor (vim)
  for quoting.
 
 Currently I am resolving 1 by using the following message-hook:
 
   message-hook '~f [EMAIL PROTECTED]' 'set display_filter=sed -f 
 ~/bin/fix_m.sed'

Why not use:  set display_filter=/usr/bin/dos2unix

 Where fix_m.sed strips out the ^M's and replaces them with my preferred
 newlines.
 
 However, if I hit reply to this message, everything shows up in vim in
 the original format -- ie with the ^M's all intact and everything on
 one line.
 
 I can correct this from wtihin vim, but I'd prefer it all be automated.

How do you get your E-Mails?

Do you use procmail?

Since I am on mailinglists which support Linux AND WINDOWS, I get this
^M regulary...
...and use:



# FLT_dos_coded

:0 fw
* ^1^ \r\n
* ? which dos2unix /dev/null 21
|/usr/bin/dos2unix



Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: Best way to handle DOS newlines

2007-05-10 Thread Alain Bench
Hello Markus, Ray,

 On Tuesday, May 8, 2007 at 7:48:18 +0200, Markus Maria Miedaner wrote:

 On Mon, May 07, 2007 at 05:59:43PM -0700, you (Ray Van Dolson) wrote:
 DOS/Windows newlines instead of Unix ones. All the text shows up as
 one large line interspersed with ^M^M's.

Are you sure those are not Mac newlines? DOS newlines display lines
ending in one ^M.


 However, if I hit reply to this message, everything shows up in vim
 in the original format

Indeed $display_filter acts only on pager display, not on the quoted
template passed to $editor when replying.


 my suggestion is to use iconv instead of your script.

Iconv is a tool to convert characters encoding (AKA charsets), not
EOL encoding. I fear that won't do it, unfortunately.


Bye!Alain.
-- 
How to Report Bugs Effectively
URL:http://www.chiark.greenend.org.uk/~sgtatham/bugs.html


Re: Best way to handle DOS newlines

2007-05-08 Thread Gary Johnson
On 2007-05-07, Ray Van Dolson [EMAIL PROTECTED] wrote:
 I occasionally get emails generated from a web application here at work
 that uses DOS/Windows newlines instead of Unix ones.  All the text
 shows up as one large line interspersed with ^M^M's.  I'd like to
 figure out a good way to:
 
   1. Correct this in the pager view of the message.
   2. Correct this prior to the message being passed to my editor (vim)
  for quoting.
 
 Currently I am resolving 1 by using the following message-hook:
 
   message-hook '~f [EMAIL PROTECTED]' 'set display_filter=sed -f 
 ~/bin/fix_m.sed'
 
 Where fix_m.sed strips out the ^M's and replaces them with my preferred
 newlines.
 
 However, if I hit reply to this message, everything shows up in vim in
 the original format -- ie with the ^M's all intact and everything on
 one line.
 
 I can correct this from wtihin vim, but I'd prefer it all be automated.
 
 I tried a reply-hook similar to my message-hook above, but had no
 success.
 
 Any suggestions?

You could use a message-hook (even the same message-hook) to also
set 'editor' to vim with a -c option to execute a vim command to fix
those lines, e.g.,

   message-hook '~A'   'set editor=vim'
   message-hook '~f [EMAIL PROTECTED]' 'set editor=vim -c \%!sed -f 
~/bin/fix_m.sed\'

HTH,
Gary

-- 
Gary Johnson   | Agilent Technologies
[EMAIL PROTECTED]   | Mobile Broadband Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA


Best way to handle DOS newlines

2007-05-07 Thread Ray Van Dolson
I occasionally get emails generated from a web application here at work
that uses DOS/Windows newlines instead of Unix ones.  All the text
shows up as one large line interspersed with ^M^M's.  I'd like to
figure out a good way to:

  1. Correct this in the pager view of the message.
  2. Correct this prior to the message being passed to my editor (vim)
 for quoting.

Currently I am resolving 1 by using the following message-hook:

  message-hook '~f [EMAIL PROTECTED]' 'set display_filter=sed -f 
~/bin/fix_m.sed'

Where fix_m.sed strips out the ^M's and replaces them with my preferred
newlines.

However, if I hit reply to this message, everything shows up in vim in
the original format -- ie with the ^M's all intact and everything on
one line.

I can correct this from wtihin vim, but I'd prefer it all be automated.

I tried a reply-hook similar to my message-hook above, but had no
success.

Any suggestions?

Ray


Re: Best way to handle DOS newlines

2007-05-07 Thread Markus Maria Miedaner
On Mon, May 07, 2007 at 05:59:43PM -0700, you (Ray Van Dolson) wrote:
 I occasionally get emails generated from a web application here at work
 that uses DOS/Windows newlines instead of Unix ones.  All the text
 shows up as one large line interspersed with ^M^M's.  I'd like to
 figure out a good way to:
 
   1. Correct this in the pager view of the message.
   2. Correct this prior to the message being passed to my editor (vim)
  for quoting.
 
 Currently I am resolving 1 by using the following message-hook:
 
   message-hook '~f [EMAIL PROTECTED]' 'set display_filter=sed -f 
 ~/bin/fix_m.sed'
 
 Where fix_m.sed strips out the ^M's and replaces them with my preferred
 newlines.
 
 However, if I hit reply to this message, everything shows up in vim in
 the original format -- ie with the ^M's all intact and everything on
 one line.
 
 I can correct this from wtihin vim, but I'd prefer it all be automated.
 
 I tried a reply-hook similar to my message-hook above, but had no
 success.
 
 Any suggestions?
 
 Ray

Hi Ray,

my suggestion is to use iconv instead of your script.
here part of the man page:

NAME
   iconv - Convert encoding of given files from one encoding to another

SYNOPSIS
  iconv -f encoding -t encoding inputfile

DESCRIPTION
The iconv program converts the encoding of characters in inputfile from one 
coded character set to another. The result is written to standard output unless
otherwise specified by the --output option.

as far as I understand it, removing the end_of_line characters does not change 
the encoding of your original file - and that's why vim
will show these again, even you removed them.

markus