From 1717666662c484253c203e3596ddb0b561c90a21 Mon Sep 17 00:00:00 2001 From: h2so5 Date: Thu, 23 Jan 2014 02:20:30 +0900 Subject: fix utf-8 codepage --- mrbgems/mruby-string-utf8/src/string.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'mrbgems/mruby-string-utf8/src') diff --git a/mrbgems/mruby-string-utf8/src/string.c b/mrbgems/mruby-string-utf8/src/string.c index 326d79e40..2dd848c86 100644 --- a/mrbgems/mruby-string-utf8/src/string.c +++ b/mrbgems/mruby-string-utf8/src/string.c @@ -7,7 +7,7 @@ /* TODO: duplicate definition in src/re.h */ #define REGEXP_CLASS "Regexp" -static size_t utf8len_tab[256] = +static const char utf8len_codepage[256] = { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, @@ -16,7 +16,7 @@ static size_t utf8len_tab[256] = 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, - 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,6,6,1,1, + 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,1,1,1,1,1,1,1,1,1,1,1, }; static size_t @@ -27,7 +27,7 @@ utf8len(unsigned char* p) if (*p == 0) return 1; - len = utf8len_tab[*p]; + len = utf8len_codepage[*p]; for (i = 1; i < len; ++i) if ((p[i] & 0xc0) != 0x80) return 1; -- cgit v1.2.3