Add wide font support to Core Text renderer
[MacVim/KaoriYa.git] / src / po / sjiscorr.c
blobd7706ba73073be008bf210d23b1922f72f1cb380
1 /*
2 * Simplistic program to correct SJIS inside strings. When a trail byte is a
3 * backslash it needs to be doubled.
4 * Public domain.
5 */
6 #include <stdio.h>
7 #include <string.h>
9 int
10 main(argc, argv)
11 int argc;
12 char **argv;
14 char buffer[BUFSIZ];
15 char *p;
17 while (fgets(buffer, BUFSIZ, stdin) != NULL)
19 for (p = buffer; *p != 0; p++)
21 if (strncmp(p, "charset=euc-jp", 14) == 0)
23 fputs("charset=cp932", stdout);
24 p += 13;
26 else if (strncmp(p, "ja.po - Japanese message file", 29) == 0)
28 fputs("ja.sjis.po - Japanese message file for Vim (version 6.x)\n", stdout);
29 fputs("# generated from ja.po, DO NOT EDIT", stdout);
30 while (p[1] != '\n')
31 ++p;
33 else if (*(unsigned char *)p == 0x81 && p[1] == '_')
35 putchar('\\');
36 ++p;
38 else
40 if (*p & 0x80)
42 putchar(*p++);
43 if (*p == '\\')
44 putchar(*p);
46 putchar(*p);