Re: Clearing bit 7?
From: mjt (mjtobler_at_removethis_mail.ru)
Date: 07/25/04
- Next message: Star Fleet Admiral Q: "Re: Point Of Sale"
- Previous message: MarkO: "PPP Slack 9.1 kernel 2.4.18"
- In reply to: Forrest: "Clearing bit 7?"
- Next in thread: Forrest: "Re: Clearing bit 7?"
- Reply: Forrest: "Re: Clearing bit 7?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 25 Jul 2004 00:24:47 GMT
Forrest wrote:
> I've discovered some ancient text files that would be plain ASCII had
> not their characters' high bit gotten set by some bizarre accident.
>
> Is undoing this sort of damage something that can be addressed easily
> from the command line, or will programming be required? (Google is
> intimating the latter, but maybe I phrased the queries badly.)
the following should do it:
+++++++++++++++++++ snipline +++++++++++++++++++++++++++++++++++++
#include <stdio.h>
int main( )
{
char ch ;
while( (ch = getchar()) != EOF )
{
ch = ch & 0177;
putchar( ch ) ;
}
return( 0 );
}
+++++++++++++++++++ snipline +++++++++++++++++++++++++++++++++++++
-- << http://michaeljtobler.homelinux.com/ >> Genius may have its limitations, but stupidity is not thus handicapped. - Elbert Hubbard
- Next message: Star Fleet Admiral Q: "Re: Point Of Sale"
- Previous message: MarkO: "PPP Slack 9.1 kernel 2.4.18"
- In reply to: Forrest: "Clearing bit 7?"
- Next in thread: Forrest: "Re: Clearing bit 7?"
- Reply: Forrest: "Re: Clearing bit 7?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|