home *** CD-ROM | disk | FTP | other *** search
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-
-
- void main (int argc, char *argv[])
-
- { FILE *fhin, *fhout;
- unsigned int c;
-
- if (argc != 3 || *argv[1] == '?')
- { fprintf(stderr, "Usage: convert <infile> <outfile>>\n\n");
- fprintf(stderr, "convert removes the german Umlaut's from infile and "
- "writes the changed file\n");
- fprintf(stderr, "to outfile.\n");
- exit(1);
- }
-
- if (!(fhin = fopen(argv[1], "r")))
- { fprintf(stderr, "Cannot open %s as output.\n", argv[1]);
- exit (10);
- }
- if (!(fhout = fopen(argv[2], "w")))
- { fprintf(stderr, "Cannot open %s as input.\n", argv[2]);
- exit (10);
- }
-
- while(!feof(fhin))
- { switch(c = getc(fhin))
- { case '\344':
- fputs("ae", fhout);
- break;
- case '\366':
- fputs("oe", fhout);
- break;
- case '\374':
- fputs("ue", fhout);
- break;
- case '\337':
- fputs("ss", fhout);
- break;
- case '\304':
- fputs("Ae", fhout);
- break;
- case '\326':
- fputs("Oe", fhout);
- break;
- case '\334':
- fputs("Ue", fhout);
- break;
- default:
- putc(c, fhout);
- }
- }
- }
-