Mercurial > vim
annotate src/po/sjiscorr.c @ 10392:957a1d560bda v8.0.0090
commit https://github.com/vim/vim/commit/6c896867c4f5d759616028ef7cbfce2a9ed32600
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 17 19:46:51 2016 +0100
patch 8.0.0090
Problem: Test_help_complete sometimes fails in MS-Windows console.
Solution: Use getcompletion() instead of feedkeys() and command line
completion. (Hirohito Higashi)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 17 Nov 2016 20:00:05 +0100 |
parents | 226ed297307f |
children | b79453d0d01c |
rev | line source |
---|---|
7 | 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> | |
8 | |
9 int | |
7856
226ed297307f
commit https://github.com/vim/vim/commit/d14e00ea67afbaa8cb4a7e6b1eb306da6a2d5adb
Christian Brabandt <cb@256bit.org>
parents:
7837
diff
changeset
|
10 main(int argc, char **argv) |
7 | 11 { |
12 char buffer[BUFSIZ]; | |
13 char *p; | |
14 | |
15 while (fgets(buffer, BUFSIZ, stdin) != NULL) | |
16 { | |
17 for (p = buffer; *p != 0; p++) | |
18 { | |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
19 if (strncmp(p, "charset=utf-8", 13) == 0) |
7 | 20 { |
21 fputs("charset=cp932", stdout); | |
4502
605c9ce57ec3
Updated runtime files, language files and translations.
Bram Moolenaar <bram@vim.org>
parents:
7
diff
changeset
|
22 p += 12; |
7 | 23 } |
6351 | 24 else if (strncmp(p, "# Original translations", 23) == 0) |
7 | 25 { |
26 fputs("# generated from ja.po, DO NOT EDIT", stdout); | |
27 while (p[1] != '\n') | |
28 ++p; | |
29 } | |
30 else if (*(unsigned char *)p == 0x81 && p[1] == '_') | |
31 { | |
32 putchar('\\'); | |
33 ++p; | |
34 } | |
35 else | |
36 { | |
37 if (*p & 0x80) | |
38 { | |
39 putchar(*p++); | |
40 if (*p == '\\') | |
41 putchar(*p); | |
42 } | |
43 putchar(*p); | |
44 } | |
45 } | |
46 } | |
47 } |