/* * sjis2euc - filter to convert SJIS into EUC (\xxx\yyy) */ #include main() { int c, k; while ((c = getchar()) != EOF) { if (!(c & 0x80)) { putchar(c); continue; } k = getchar(); c = (c * 2) - ((c <= 0x9f)? 0xe1 : 0x161); if (k < 0x9f) k -= ((k > 0x7f) ? 0x20 : 0x1f); else { c ++; k -= 0x7e; } printf("\\%03o\\%03o", c | 0x80, k | 0x80); } exit(0); }