Re: Clearing bit 7?

From: mjt (mjtobler_at_removethis_mail.ru)
Date: 07/25/04


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


Relevant Pages

  • Clearing bit 7?
    ... not their characters' high bit gotten set by some bizarre accident. ... Is undoing this sort of damage something that can be addressed easily ...
    (comp.os.linux.questions)
  • Re: Rules for avoiding crap books
    ... some sort that maintains the structure and the commons, ... A homeowners' association is the same thing, but for a planned community ... want those maintained at a higher level than does the local government. ... The hassle comes in to play when the defenition of "damage" starts to creep ...
    (rec.arts.sf.written)
  • Re: Stigma.
    ... operation you also underwent some urological procedure that you had ... not authorised, which caused some sort of damage to you, then you ... that is a result from a nerve block that lasts for a week.. ...
    (uk.legal)
  • Re: I see mention here of old boyfriend fron 1962 in San Francisco
    ... Sheri's affection welcomes sort of our version after we damage ... Well, waists comply let alone running insides, unless they're ... israeli. ...
    (sci.crypt)
  • Re: Accident claim information
    ... Sounds like a Trafic - sort of Transit sized? ... To be honest, the damage to ... Don't forget the insurers ... the excess and increased premium in the future). ...
    (uk.rec.cars.maintenance)