mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/nkf/nkf-utf8/nkf.c (nkf_buf): use nkf_char.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
11c00acf8e
commit
3c13fd9be0
2 changed files with 26 additions and 20 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Jan 20 17:50:00 2009 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/nkf/nkf-utf8/nkf.c (nkf_buf): use nkf_char.
|
||||||
|
|
||||||
Tue Jan 20 16:17:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Jan 20 16:17:12 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* cont.c (ruby_Init_{Continuation_body,Fiber_as_Coroutine}): prefixed
|
* cont.c (ruby_Init_{Continuation_body,Fiber_as_Coroutine}): prefixed
|
||||||
|
|
|
@ -802,7 +802,7 @@ nkf_default_encoding()
|
||||||
typedef struct {
|
typedef struct {
|
||||||
long capa;
|
long capa;
|
||||||
long len;
|
long len;
|
||||||
unsigned char *ptr;
|
nkf_char *ptr;
|
||||||
} nkf_buf_t;
|
} nkf_buf_t;
|
||||||
|
|
||||||
static nkf_buf_t *
|
static nkf_buf_t *
|
||||||
|
@ -873,17 +873,20 @@ usage(void)
|
||||||
{
|
{
|
||||||
fprintf(HELP_OUTPUT,
|
fprintf(HELP_OUTPUT,
|
||||||
"Usage: nkf -[flags] [--] [in file] .. [out file for -O flag]\n"
|
"Usage: nkf -[flags] [--] [in file] .. [out file for -O flag]\n"
|
||||||
" j,s,e,w Output code is ISO-2022-JP, Shift JIS, EUC-JP, UTF-8N\n"
|
|
||||||
#ifdef UTF8_OUTPUT_ENABLE
|
#ifdef UTF8_OUTPUT_ENABLE
|
||||||
" After 'w' you can add more options. -w[ 8 [0], 16 [[BL] [0]] ]\n"
|
" j/s/e/w Specify output encoding ISO-2022-JP, Shift_JIS, EUC-JP\n"
|
||||||
|
" UTF options is -w[8[0],{16,32}[{B,L}[0]]]\n"
|
||||||
|
#else
|
||||||
#endif
|
#endif
|
||||||
" J,S,E,W Input assumption is JIS 7 bit , Shift JIS, EUC-JP, UTF-8\n"
|
|
||||||
#ifdef UTF8_INPUT_ENABLE
|
#ifdef UTF8_INPUT_ENABLE
|
||||||
" After 'W' you can add more options. -W[ 8, 16 [BL] ] \n"
|
" J/S/E/W Specify input encoding ISO-2022-JP, Shift_JIS, EUC-JP\n"
|
||||||
|
" UTF option is -W[8,[16,32][B,L]]\n"
|
||||||
|
#else
|
||||||
|
" J/S/E Specify output encoding ISO-2022-JP, Shift_JIS, EUC-JP\n"
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
fprintf(HELP_OUTPUT,
|
fprintf(HELP_OUTPUT,
|
||||||
" m[BQSN0] MIME decode [B:base64,Q:quoted,S:strict,N:non-strict,0:no decode]\n"
|
" m[BQSN0] MIME decode [B:base64,Q:quoted,S:strict,N:nonstrict,0:no decode]\n"
|
||||||
" M[BQ] MIME encode [B:base64 Q:quoted]\n"
|
" M[BQ] MIME encode [B:base64 Q:quoted]\n"
|
||||||
" f/F Folding: -f60 or -f or -f60-10 (fold margin 10) F preserve nl\n"
|
" f/F Folding: -f60 or -f or -f60-10 (fold margin 10) F preserve nl\n"
|
||||||
);
|
);
|
||||||
|
@ -898,32 +901,31 @@ usage(void)
|
||||||
" L[uwm] Line mode u:LF w:CRLF m:CR (DEFAULT noconversion)\n"
|
" L[uwm] Line mode u:LF w:CRLF m:CR (DEFAULT noconversion)\n"
|
||||||
);
|
);
|
||||||
fprintf(HELP_OUTPUT,
|
fprintf(HELP_OUTPUT,
|
||||||
"Long name options\n"
|
" --ic=<encoding> Specify the input encoding\n"
|
||||||
" --ic=<input codeset> --oc=<output codeset>\n"
|
" --oc=<encoding> Specify the output encoding\n"
|
||||||
" Specify the input or output codeset\n"
|
" --hiragana --katakana Hiragana/Katakana Conversion\n"
|
||||||
" --hiragana --katakana --katakana-hiragana\n"
|
" --katakana-hiragana Converts each other\n"
|
||||||
" To Hiragana/Katakana Conversion\n"
|
|
||||||
);
|
);
|
||||||
fprintf(HELP_OUTPUT,
|
fprintf(HELP_OUTPUT,
|
||||||
#ifdef INPUT_OPTION
|
#ifdef INPUT_OPTION
|
||||||
" --cap-input, --url-input Convert hex after ':' or '%%'\n"
|
" --{cap, url}-input Convert hex after ':' or '%%'\n"
|
||||||
#endif
|
#endif
|
||||||
#ifdef NUMCHAR_OPTION
|
#ifdef NUMCHAR_OPTION
|
||||||
" --numchar-input Convert Unicode Character Reference\n"
|
" --numchar-input Convert Unicode Character Reference\n"
|
||||||
#endif
|
#endif
|
||||||
#ifdef UTF8_INPUT_ENABLE
|
#ifdef UTF8_INPUT_ENABLE
|
||||||
" --fb-{skip, html, xml, perl, java, subchar}\n"
|
" --fb-{skip, html, xml, perl, java, subchar}\n"
|
||||||
" Specify how nkf handles unassigned characters\n"
|
" Specify unassigned character's replacement\n"
|
||||||
#endif
|
#endif
|
||||||
);
|
);
|
||||||
fprintf(HELP_OUTPUT,
|
fprintf(HELP_OUTPUT,
|
||||||
#ifdef OVERWRITE
|
#ifdef OVERWRITE
|
||||||
" --in-place[=SUF] Overwrite original listed files by filtered result\n"
|
" --in-place[=SUF] Overwrite original files\n"
|
||||||
" --overwrite[=SUF] in-place and preserve timestamp of original files\n"
|
" --overwrite[=SUF] Preserve timestamp of original files\n"
|
||||||
#endif
|
#endif
|
||||||
" -g --guess Guess the input code\n"
|
" -g --guess Guess the input code\n"
|
||||||
" -v --version print the version\n"
|
" -v --version Print the version\n"
|
||||||
" --help/-V print this help / configuration\n"
|
" --help/-V Print this help / configuration\n"
|
||||||
);
|
);
|
||||||
version();
|
version();
|
||||||
}
|
}
|
||||||
|
@ -4263,7 +4265,7 @@ nfc_getc(FILE *f)
|
||||||
|
|
||||||
if (c == EOF || c > 0xFF || (c & 0xc0) == 0x80) return c;
|
if (c == EOF || c > 0xFF || (c & 0xc0) == 0x80) return c;
|
||||||
|
|
||||||
nkf_buf_push(buf, (unsigned char)c);
|
nkf_buf_push(buf, c);
|
||||||
do {
|
do {
|
||||||
while (lower <= upper) {
|
while (lower <= upper) {
|
||||||
int mid = (lower+upper) / 2;
|
int mid = (lower+upper) / 2;
|
||||||
|
|
Loading…
Add table
Reference in a new issue