/* ¤³¤ó¤Ö */ #include static char *conv_tbl[94] = { " ", ",", ";", ",", ".", ".", ":", ";", "?", "!", "\""," ", "'", "`", " ", "^", "~", "_", "¡³","¡´","¡µ","¡¶","¡·","¡¸","¡¹","¡º","¡»","¡¼","¡½","-", "/", "\\", "~", "||","|", "¡Ä","¡Å","`", "'", "\"","\"","(", ")", "[", "]", "[", "]", "{", "}", "<", ">", "<", ">", "(", ")", "{", "}", "[", "]", "+", "-", "¡Þ","*", "/", "=", "!=","<", ">", "<=",">=","¡ç","¡è","¡é","¡ê","¡ë","'", "\"","¡î","\\","$", "¡ñ","¡ò","%", "#", "&", "*", "@", "¡ø","¡ù","¡ú","¡û","¡ü","¡ý","¡þ"}; main(argc, argv) int argc; char *argv[]; { int c1, c2, i; if (argc == 1) puts("#include \"ha.h\""); while((c1 = getchar()) != EOF) { if (c1 & 0x80) { c2 = getchar(); switch (c1) { case 0xa1: if ((0xa0 < c2) && (0xa2 < 0xff)) { if (0x80 & conv_tbl[c2-0xa1][0] == 0) printf("X%2x%2x", c1&0x7f, c2&0x7f); else for(i = 0; conv_tbl[c2-0xa1][i] != '\0'; ++ i) putchar(conv_tbl[c2-0xa1][i]); } else { printf("X%2x%2x", c1&0x7f, c2&0x7f); } break; case 0xa3: putchar (c2 & 0x7f); break; default: printf("X%2x%2x", c1&0x7f, c2&0x7f); } } else switch(c1) { case '"': process_string(); break; case '/': c2 = getchar(); ungetc(c2, stdin); if (c2 == '*') process_comment(); else putchar(c1); break; default: putchar(c1); } } return 0; } process_string() { int c; putchar('"'); while((c = getchar()) != EOF) { putchar(c); if (c == '"') return; if (c == '\\') putchar(getchar()); } } process_comment() { int c1, c2; putchar('/'); putchar('*'); while((c1 = getchar()) != EOF) { putchar(c1); if (c1 == '*') { c2 = getchar(); ungetc(c2, stdin); if (c2 == '/') { return; } } } }