Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Remove the unicodes
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv) {
char buffer[4096];
FILE* inf = fopen(argv[1], "r");
FILE* outf = fopen(argv[2], "w");
while(fgets(buffer ,4096, inf)) {
char* c = buffer;
while(*c != '\n' && (unsigned char)*c >= 0x20
&& (unsigned char)*c <= 0x7F) {
c++;
}
if(*c == '\n')
fputs(buffer,outf);
}
fclose(inf);
fclose(outf);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment