* ext/nkf/nkf-utf8/nkf.c (kanji_convert): output unicode chars.
[ruby-dev:36957] * ext/nkf/nkf-utf8/nkf.c (numchar_getc): increase buffer size. reported and patched at [ruby-dev:36957] by mame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d8c68028fa
commit
b87182fa7f
@ -1,3 +1,11 @@
|
|||||||
|
Tue Oct 28 23:29:06 2008 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/nkf/nkf-utf8/nkf.c (kanji_convert): output unicode chars.
|
||||||
|
[ruby-dev:36957]
|
||||||
|
|
||||||
|
* ext/nkf/nkf-utf8/nkf.c (numchar_getc): increase buffer size.
|
||||||
|
reported and patched at [ruby-dev:36957] by mame.
|
||||||
|
|
||||||
Tue Oct 28 23:03:46 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
Tue Oct 28 23:03:46 2008 Yuki Sonoda (Yugui) <yugui@yugui.jp>
|
||||||
|
|
||||||
* test/ruby/test_proc.rb: filled all patterns for testing
|
* test/ruby/test_proc.rb: filled all patterns for testing
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
***********************************************************************/
|
***********************************************************************/
|
||||||
#define NKF_IDENT "$Id$"
|
#define NKF_IDENT "$Id$"
|
||||||
#define NKF_VERSION "2.0.8"
|
#define NKF_VERSION "2.0.8"
|
||||||
#define NKF_RELEASE_DATE "2008-02-08"
|
#define NKF_RELEASE_DATE "2008-10-28"
|
||||||
#define COPY_RIGHT \
|
#define COPY_RIGHT \
|
||||||
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW\n" \
|
"Copyright (C) 1987, FUJITSU LTD. (I.Ichikawa),2000 S. Kono, COW\n" \
|
||||||
"Copyright (C) 2002-2008 Kono, Furukawa, Naruse, mastodon"
|
"Copyright (C) 2002-2008 Kono, Furukawa, Naruse, mastodon"
|
||||||
@ -41,6 +41,10 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "nkf.h"
|
#include "nkf.h"
|
||||||
#include "utf8tbl.h"
|
#include "utf8tbl.h"
|
||||||
|
#ifdef __WIN32__
|
||||||
|
#include <windows.h>
|
||||||
|
#include <locale.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* state of output_mode and input_mode
|
/* state of output_mode and input_mode
|
||||||
|
|
||||||
@ -718,7 +722,16 @@ nkf_locale_charmap()
|
|||||||
#ifdef HAVE_LANGINFO_H
|
#ifdef HAVE_LANGINFO_H
|
||||||
return nl_langinfo(CODESET);
|
return nl_langinfo(CODESET);
|
||||||
#elif defined(__WIN32__)
|
#elif defined(__WIN32__)
|
||||||
return sprintf("CP%d", GetACP());
|
char buf[16];
|
||||||
|
char *str;
|
||||||
|
int len = sprintf(buf, "CP%d", GetACP());
|
||||||
|
if (len > 0) {
|
||||||
|
str = malloc(len + 1);
|
||||||
|
strcpy(str, buf);
|
||||||
|
str[len] = '\0';
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
else return NULL;
|
||||||
#else
|
#else
|
||||||
return NULL;
|
return NULL;
|
||||||
#endif
|
#endif
|
||||||
@ -4100,7 +4113,7 @@ numchar_getc(FILE *f)
|
|||||||
nkf_char (*g)(FILE *) = i_ngetc;
|
nkf_char (*g)(FILE *) = i_ngetc;
|
||||||
nkf_char (*u)(nkf_char c ,FILE *f) = i_nungetc;
|
nkf_char (*u)(nkf_char c ,FILE *f) = i_nungetc;
|
||||||
int i = 0, j;
|
int i = 0, j;
|
||||||
nkf_char buf[8];
|
nkf_char buf[12];
|
||||||
long c = -1;
|
long c = -1;
|
||||||
|
|
||||||
buf[i] = (*g)(f);
|
buf[i] = (*g)(f);
|
||||||
@ -5328,6 +5341,10 @@ kanji_convert(FILE *f)
|
|||||||
SEND;
|
SEND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (nkf_char_unicode_p(c1)) {
|
||||||
|
(*oconv)(0, c1);
|
||||||
|
NEXT;
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* first byte */
|
/* first byte */
|
||||||
if (input_mode == JIS_X_0208 && DEL <= c1 && c1 < 0x92) {
|
if (input_mode == JIS_X_0208 && DEL <= c1 && c1 < 0x92) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user