Back to index

php5  5.3.10
utf8.c
Go to the documentation of this file.
00001 /**********************************************************************
00002   utf8.c -  Oniguruma (regular expression library)
00003 **********************************************************************/
00004 /*-
00005  * Copyright (c) 2002-2006  K.Kosako  <sndgk393 AT ybb DOT ne DOT jp>
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  *
00017  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
00018  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00019  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00020  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00021  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00022  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00023  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00024  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00025  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00026  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00027  * SUCH DAMAGE.
00028  */
00029 
00030 #include "regenc.h"
00031 
00032 #define USE_INVALID_CODE_SCHEME
00033 
00034 #ifdef USE_INVALID_CODE_SCHEME
00035 /* virtual codepoint values for invalid encoding byte 0xfe and 0xff */
00036 #define INVALID_CODE_FE   0xfffffffe
00037 #define INVALID_CODE_FF   0xffffffff
00038 #define VALID_CODE_LIMIT  0x7fffffff
00039 #endif
00040 
00041 #define utf8_islead(c)     ((UChar )((c) & 0xc0) != 0x80)
00042 
00043 static const int EncLen_UTF8[] = {
00044   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00045   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00046   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00047   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00048   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00049   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00050   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00051   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00052   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00053   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00054   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00055   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
00056   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00057   2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
00058   3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
00059   4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 1, 1
00060 };
00061 
00062 static int
00063 utf8_mbc_enc_len(const UChar* p)
00064 {
00065   return EncLen_UTF8[*p];
00066 }
00067 
00068 static int
00069 utf8_is_mbc_newline(const UChar* p, const UChar* end)
00070 {
00071   if (p < end) {
00072     if (*p == 0x0a) return 1;
00073 
00074 #ifdef USE_UNICODE_ALL_LINE_TERMINATORS
00075     if (*p == 0x0d) return 1;
00076     if (p + 1 < end) {
00077       if (*(p+1) == 0x85 && *p == 0xc2) /* U+0085 */
00078        return 1;
00079       if (p + 2 < end) {
00080        if ((*(p+2) == 0xa8 || *(p+2) == 0xa9)
00081            && *(p+1) == 0x80 && *p == 0xe2)  /* U+2028, U+2029 */
00082          return 1;
00083       }
00084     }
00085 #endif
00086   }
00087 
00088   return 0;
00089 }
00090 
00091 static OnigCodePoint
00092 utf8_mbc_to_code(const UChar* p, const UChar* end)
00093 {
00094   int c, len;
00095   OnigCodePoint n;
00096 
00097   len = enc_len(ONIG_ENCODING_UTF8, p);
00098   c = *p++;
00099   if (len > 1) {
00100     len--;
00101     n = c & ((1 << (6 - len)) - 1);
00102     while (len--) {
00103       c = *p++;
00104       n = (n << 6) | (c & ((1 << 6) - 1));
00105     }
00106     return n;
00107   }
00108   else {
00109 #ifdef USE_INVALID_CODE_SCHEME
00110     if (c > 0xfd) {
00111       return ((c == 0xfe) ? INVALID_CODE_FE : INVALID_CODE_FF);
00112     }
00113 #endif
00114     return (OnigCodePoint )c;
00115   }
00116 }
00117 
00118 static int
00119 utf8_code_to_mbclen(OnigCodePoint code)
00120 {
00121   if      ((code & 0xffffff80) == 0) return 1;
00122   else if ((code & 0xfffff800) == 0) {
00123     if (code <= 0xff && code >= 0xfe)
00124       return 1;
00125     return 2;
00126   }
00127   else if ((code & 0xffff0000) == 0) return 3;
00128   else if ((code & 0xffe00000) == 0) return 4;
00129   else if ((code & 0xfc000000) == 0) return 5;
00130   else if ((code & 0x80000000) == 0) return 6;
00131 #ifdef USE_INVALID_CODE_SCHEME
00132   else if (code == INVALID_CODE_FE) return 1;
00133   else if (code == INVALID_CODE_FF) return 1;
00134 #endif
00135   else
00136     return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
00137 }
00138 
00139 #if 0
00140 static int
00141 utf8_code_to_mbc_first(OnigCodePoint code)
00142 {
00143   if ((code & 0xffffff80) == 0)
00144     return code;
00145   else {
00146     if ((code & 0xfffff800) == 0)
00147       return ((code>>6)& 0x1f) | 0xc0;
00148     else if ((code & 0xffff0000) == 0)
00149       return ((code>>12) & 0x0f) | 0xe0;
00150     else if ((code & 0xffe00000) == 0)
00151       return ((code>>18) & 0x07) | 0xf0;
00152     else if ((code & 0xfc000000) == 0)
00153       return ((code>>24) & 0x03) | 0xf8;
00154     else if ((code & 0x80000000) == 0)
00155       return ((code>>30) & 0x01) | 0xfc;
00156     else {
00157       return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
00158     }
00159   }
00160 }
00161 #endif
00162 
00163 static int
00164 utf8_code_to_mbc(OnigCodePoint code, UChar *buf)
00165 {
00166 #define UTF8_TRAILS(code, shift) (UChar )((((code) >> (shift)) & 0x3f) | 0x80)
00167 #define UTF8_TRAIL0(code)        (UChar )(((code) & 0x3f) | 0x80)
00168 
00169   if ((code & 0xffffff80) == 0) {
00170     *buf = (UChar )code;
00171     return 1;
00172   }
00173   else {
00174     UChar *p = buf;
00175 
00176     if ((code & 0xfffff800) == 0) {
00177       *p++ = (UChar )(((code>>6)& 0x1f) | 0xc0);
00178     }
00179     else if ((code & 0xffff0000) == 0) {
00180       *p++ = (UChar )(((code>>12) & 0x0f) | 0xe0);
00181       *p++ = UTF8_TRAILS(code, 6);
00182     }
00183     else if ((code & 0xffe00000) == 0) {
00184       *p++ = (UChar )(((code>>18) & 0x07) | 0xf0);
00185       *p++ = UTF8_TRAILS(code, 12);
00186       *p++ = UTF8_TRAILS(code,  6);
00187     }
00188     else if ((code & 0xfc000000) == 0) {
00189       *p++ = (UChar )(((code>>24) & 0x03) | 0xf8);
00190       *p++ = UTF8_TRAILS(code, 18);
00191       *p++ = UTF8_TRAILS(code, 12);
00192       *p++ = UTF8_TRAILS(code,  6);
00193     }
00194     else if ((code & 0x80000000) == 0) {
00195       *p++ = (UChar )(((code>>30) & 0x01) | 0xfc);
00196       *p++ = UTF8_TRAILS(code, 24);
00197       *p++ = UTF8_TRAILS(code, 18);
00198       *p++ = UTF8_TRAILS(code, 12);
00199       *p++ = UTF8_TRAILS(code,  6);
00200     }
00201 #ifdef USE_INVALID_CODE_SCHEME
00202     else if (code == INVALID_CODE_FE) {
00203       *p = 0xfe;
00204       return 1;
00205     }
00206     else if (code == INVALID_CODE_FF) {
00207       *p = 0xff;
00208       return 1;
00209     }
00210 #endif
00211     else {
00212       return ONIGENCERR_TOO_BIG_WIDE_CHAR_VALUE;
00213     }
00214 
00215     *p++ = UTF8_TRAIL0(code);
00216     return p - buf;
00217   }
00218 }
00219 
00220 static int
00221 utf8_mbc_to_normalize(OnigAmbigType flag, const UChar** pp, const UChar* end, UChar* lower)
00222 {
00223   const UChar* p = *pp;
00224 
00225   if (ONIGENC_IS_MBC_ASCII(p)) {
00226     if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) {
00227       *lower = ONIGENC_ASCII_CODE_TO_LOWER_CASE(*p);
00228     }
00229     else {
00230       *lower = *p;
00231     }
00232     (*pp)++;
00233     return 1; /* return byte length of converted char to lower */
00234   }
00235   else {
00236     int len;
00237 
00238     if (*p == 195) { /* 195 == '\303' */
00239       int c = *(p + 1);
00240       if (c >= 128) {
00241         if (c <= (UChar )'\236' &&  /* upper */
00242             (flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0) {
00243           if (c != (UChar )'\227') {
00244             *lower++ = *p;
00245             *lower   = (UChar )(c + 32);
00246             (*pp) += 2;
00247             return 2;
00248           }
00249         }
00250       }
00251     }
00252 
00253     len = enc_len(ONIG_ENCODING_UTF8, p);
00254     if (lower != p) {
00255       int i;
00256       for (i = 0; i < len; i++) {
00257        *lower++ = *p++;
00258       }
00259     }
00260     (*pp) += len;
00261     return len; /* return byte length of converted char to lower */
00262   }
00263 }
00264 
00265 static int
00266 utf8_is_mbc_ambiguous(OnigAmbigType flag, const UChar** pp, const UChar* end)
00267 {
00268   const UChar* p = *pp;
00269 
00270   if (ONIGENC_IS_MBC_ASCII(p)) {
00271     (*pp)++;
00272     if ((flag & ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE) != 0) {
00273       return ONIGENC_IS_ASCII_CODE_CASE_AMBIG(*p);
00274     }
00275   }
00276   else {
00277     (*pp) += enc_len(ONIG_ENCODING_UTF8, p);
00278 
00279     if (*p == 195) { /* 195 == '\303' */
00280       int c = *(p + 1);
00281       if (c >= 128) {
00282         if ((flag & ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE) != 0) {
00283           if (c <= (UChar )'\236') { /* upper */
00284             if (c == (UChar )'\227') return FALSE;
00285             return TRUE;
00286           }
00287           else if (c >= (UChar )'\240' && c <= (UChar )'\276') { /* lower */
00288             if (c == (UChar )'\267') return FALSE;
00289             return TRUE;
00290           }
00291         }
00292       }
00293     }
00294   }
00295 
00296   return FALSE;
00297 }
00298 
00299 
00300 static const OnigCodePoint EmptyRange[] = { 0 };
00301 
00302 static const OnigCodePoint SBAlnum[] = {
00303   3,
00304   0x0030, 0x0039,
00305   0x0041, 0x005a,
00306   0x0061, 0x007a
00307 };
00308 
00309 static const OnigCodePoint MBAlnum[] = {
00310 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
00311   411,
00312 #else
00313   6,
00314 #endif
00315   0x00aa, 0x00aa,
00316   0x00b5, 0x00b5,
00317   0x00ba, 0x00ba,
00318   0x00c0, 0x00d6,
00319   0x00d8, 0x00f6,
00320   0x00f8, 0x0236
00321 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
00322   ,
00323   0x0250, 0x02c1,
00324   0x02c6, 0x02d1,
00325   0x02e0, 0x02e4,
00326   0x02ee, 0x02ee,
00327   0x0300, 0x0357,
00328   0x035d, 0x036f,
00329   0x037a, 0x037a,
00330   0x0386, 0x0386,
00331   0x0388, 0x038a,
00332   0x038c, 0x038c,
00333   0x038e, 0x03a1,
00334   0x03a3, 0x03ce,
00335   0x03d0, 0x03f5,
00336   0x03f7, 0x03fb,
00337   0x0400, 0x0481,
00338   0x0483, 0x0486,
00339   0x0488, 0x04ce,
00340   0x04d0, 0x04f5,
00341   0x04f8, 0x04f9,
00342   0x0500, 0x050f,
00343   0x0531, 0x0556,
00344   0x0559, 0x0559,
00345   0x0561, 0x0587,
00346   0x0591, 0x05a1,
00347   0x05a3, 0x05b9,
00348   0x05bb, 0x05bd,
00349   0x05bf, 0x05bf,
00350   0x05c1, 0x05c2,
00351   0x05c4, 0x05c4,
00352   0x05d0, 0x05ea,
00353   0x05f0, 0x05f2,
00354   0x0610, 0x0615,
00355   0x0621, 0x063a,
00356   0x0640, 0x0658,
00357   0x0660, 0x0669,
00358   0x066e, 0x06d3,
00359   0x06d5, 0x06dc,
00360   0x06de, 0x06e8,
00361   0x06ea, 0x06fc,
00362   0x06ff, 0x06ff,
00363   0x0710, 0x074a,
00364   0x074d, 0x074f,
00365   0x0780, 0x07b1,
00366   0x0901, 0x0939,
00367   0x093c, 0x094d,
00368   0x0950, 0x0954,
00369   0x0958, 0x0963,
00370   0x0966, 0x096f,
00371   0x0981, 0x0983,
00372   0x0985, 0x098c,
00373   0x098f, 0x0990,
00374   0x0993, 0x09a8,
00375   0x09aa, 0x09b0,
00376   0x09b2, 0x09b2,
00377   0x09b6, 0x09b9,
00378   0x09bc, 0x09c4,
00379   0x09c7, 0x09c8,
00380   0x09cb, 0x09cd,
00381   0x09d7, 0x09d7,
00382   0x09dc, 0x09dd,
00383   0x09df, 0x09e3,
00384   0x09e6, 0x09f1,
00385   0x0a01, 0x0a03,
00386   0x0a05, 0x0a0a,
00387   0x0a0f, 0x0a10,
00388   0x0a13, 0x0a28,
00389   0x0a2a, 0x0a30,
00390   0x0a32, 0x0a33,
00391   0x0a35, 0x0a36,
00392   0x0a38, 0x0a39,
00393   0x0a3c, 0x0a3c,
00394   0x0a3e, 0x0a42,
00395   0x0a47, 0x0a48,
00396   0x0a4b, 0x0a4d,
00397   0x0a59, 0x0a5c,
00398   0x0a5e, 0x0a5e,
00399   0x0a66, 0x0a74,
00400   0x0a81, 0x0a83,
00401   0x0a85, 0x0a8d,
00402   0x0a8f, 0x0a91,
00403   0x0a93, 0x0aa8,
00404   0x0aaa, 0x0ab0,
00405   0x0ab2, 0x0ab3,
00406   0x0ab5, 0x0ab9,
00407   0x0abc, 0x0ac5,
00408   0x0ac7, 0x0ac9,
00409   0x0acb, 0x0acd,
00410   0x0ad0, 0x0ad0,
00411   0x0ae0, 0x0ae3,
00412   0x0ae6, 0x0aef,
00413   0x0b01, 0x0b03,
00414   0x0b05, 0x0b0c,
00415   0x0b0f, 0x0b10,
00416   0x0b13, 0x0b28,
00417   0x0b2a, 0x0b30,
00418   0x0b32, 0x0b33,
00419   0x0b35, 0x0b39,
00420   0x0b3c, 0x0b43,
00421   0x0b47, 0x0b48,
00422   0x0b4b, 0x0b4d,
00423   0x0b56, 0x0b57,
00424   0x0b5c, 0x0b5d,
00425   0x0b5f, 0x0b61,
00426   0x0b66, 0x0b6f,
00427   0x0b71, 0x0b71,
00428   0x0b82, 0x0b83,
00429   0x0b85, 0x0b8a,
00430   0x0b8e, 0x0b90,
00431   0x0b92, 0x0b95,
00432   0x0b99, 0x0b9a,
00433   0x0b9c, 0x0b9c,
00434   0x0b9e, 0x0b9f,
00435   0x0ba3, 0x0ba4,
00436   0x0ba8, 0x0baa,
00437   0x0bae, 0x0bb5,
00438   0x0bb7, 0x0bb9,
00439   0x0bbe, 0x0bc2,
00440   0x0bc6, 0x0bc8,
00441   0x0bca, 0x0bcd,
00442   0x0bd7, 0x0bd7,
00443   0x0be7, 0x0bef,
00444   0x0c01, 0x0c03,
00445   0x0c05, 0x0c0c,
00446   0x0c0e, 0x0c10,
00447   0x0c12, 0x0c28,
00448   0x0c2a, 0x0c33,
00449   0x0c35, 0x0c39,
00450   0x0c3e, 0x0c44,
00451   0x0c46, 0x0c48,
00452   0x0c4a, 0x0c4d,
00453   0x0c55, 0x0c56,
00454   0x0c60, 0x0c61,
00455   0x0c66, 0x0c6f,
00456   0x0c82, 0x0c83,
00457   0x0c85, 0x0c8c,
00458   0x0c8e, 0x0c90,
00459   0x0c92, 0x0ca8,
00460   0x0caa, 0x0cb3,
00461   0x0cb5, 0x0cb9,
00462   0x0cbc, 0x0cc4,
00463   0x0cc6, 0x0cc8,
00464   0x0cca, 0x0ccd,
00465   0x0cd5, 0x0cd6,
00466   0x0cde, 0x0cde,
00467   0x0ce0, 0x0ce1,
00468   0x0ce6, 0x0cef,
00469   0x0d02, 0x0d03,
00470   0x0d05, 0x0d0c,
00471   0x0d0e, 0x0d10,
00472   0x0d12, 0x0d28,
00473   0x0d2a, 0x0d39,
00474   0x0d3e, 0x0d43,
00475   0x0d46, 0x0d48,
00476   0x0d4a, 0x0d4d,
00477   0x0d57, 0x0d57,
00478   0x0d60, 0x0d61,
00479   0x0d66, 0x0d6f,
00480   0x0d82, 0x0d83,
00481   0x0d85, 0x0d96,
00482   0x0d9a, 0x0db1,
00483   0x0db3, 0x0dbb,
00484   0x0dbd, 0x0dbd,
00485   0x0dc0, 0x0dc6,
00486   0x0dca, 0x0dca,
00487   0x0dcf, 0x0dd4,
00488   0x0dd6, 0x0dd6,
00489   0x0dd8, 0x0ddf,
00490   0x0df2, 0x0df3,
00491   0x0e01, 0x0e3a,
00492   0x0e40, 0x0e4e,
00493   0x0e50, 0x0e59,
00494   0x0e81, 0x0e82,
00495   0x0e84, 0x0e84,
00496   0x0e87, 0x0e88,
00497   0x0e8a, 0x0e8a,
00498   0x0e8d, 0x0e8d,
00499   0x0e94, 0x0e97,
00500   0x0e99, 0x0e9f,
00501   0x0ea1, 0x0ea3,
00502   0x0ea5, 0x0ea5,
00503   0x0ea7, 0x0ea7,
00504   0x0eaa, 0x0eab,
00505   0x0ead, 0x0eb9,
00506   0x0ebb, 0x0ebd,
00507   0x0ec0, 0x0ec4,
00508   0x0ec6, 0x0ec6,
00509   0x0ec8, 0x0ecd,
00510   0x0ed0, 0x0ed9,
00511   0x0edc, 0x0edd,
00512   0x0f00, 0x0f00,
00513   0x0f18, 0x0f19,
00514   0x0f20, 0x0f29,
00515   0x0f35, 0x0f35,
00516   0x0f37, 0x0f37,
00517   0x0f39, 0x0f39,
00518   0x0f3e, 0x0f47,
00519   0x0f49, 0x0f6a,
00520   0x0f71, 0x0f84,
00521   0x0f86, 0x0f8b,
00522   0x0f90, 0x0f97,
00523   0x0f99, 0x0fbc,
00524   0x0fc6, 0x0fc6,
00525   0x1000, 0x1021,
00526   0x1023, 0x1027,
00527   0x1029, 0x102a,
00528   0x102c, 0x1032,
00529   0x1036, 0x1039,
00530   0x1040, 0x1049,
00531   0x1050, 0x1059,
00532   0x10a0, 0x10c5,
00533   0x10d0, 0x10f8,
00534   0x1100, 0x1159,
00535   0x115f, 0x11a2,
00536   0x11a8, 0x11f9,
00537   0x1200, 0x1206,
00538   0x1208, 0x1246,
00539   0x1248, 0x1248,
00540   0x124a, 0x124d,
00541   0x1250, 0x1256,
00542   0x1258, 0x1258,
00543   0x125a, 0x125d,
00544   0x1260, 0x1286,
00545   0x1288, 0x1288,
00546   0x128a, 0x128d,
00547   0x1290, 0x12ae,
00548   0x12b0, 0x12b0,
00549   0x12b2, 0x12b5,
00550   0x12b8, 0x12be,
00551   0x12c0, 0x12c0,
00552   0x12c2, 0x12c5,
00553   0x12c8, 0x12ce,
00554   0x12d0, 0x12d6,
00555   0x12d8, 0x12ee,
00556   0x12f0, 0x130e,
00557   0x1310, 0x1310,
00558   0x1312, 0x1315,
00559   0x1318, 0x131e,
00560   0x1320, 0x1346,
00561   0x1348, 0x135a,
00562   0x1369, 0x1371,
00563   0x13a0, 0x13f4,
00564   0x1401, 0x166c,
00565   0x166f, 0x1676,
00566   0x1681, 0x169a,
00567   0x16a0, 0x16ea,
00568   0x1700, 0x170c,
00569   0x170e, 0x1714,
00570   0x1720, 0x1734,
00571   0x1740, 0x1753,
00572   0x1760, 0x176c,
00573   0x176e, 0x1770,
00574   0x1772, 0x1773,
00575   0x1780, 0x17b3,
00576   0x17b6, 0x17d3,
00577   0x17d7, 0x17d7,
00578   0x17dc, 0x17dd,
00579   0x17e0, 0x17e9,
00580   0x180b, 0x180d,
00581   0x1810, 0x1819,
00582   0x1820, 0x1877,
00583   0x1880, 0x18a9,
00584   0x1900, 0x191c,
00585   0x1920, 0x192b,
00586   0x1930, 0x193b,
00587   0x1946, 0x196d,
00588   0x1970, 0x1974,
00589   0x1d00, 0x1d6b,
00590   0x1e00, 0x1e9b,
00591   0x1ea0, 0x1ef9,
00592   0x1f00, 0x1f15,
00593   0x1f18, 0x1f1d,
00594   0x1f20, 0x1f45,
00595   0x1f48, 0x1f4d,
00596   0x1f50, 0x1f57,
00597   0x1f59, 0x1f59,
00598   0x1f5b, 0x1f5b,
00599   0x1f5d, 0x1f5d,
00600   0x1f5f, 0x1f7d,
00601   0x1f80, 0x1fb4,
00602   0x1fb6, 0x1fbc,
00603   0x1fbe, 0x1fbe,
00604   0x1fc2, 0x1fc4,
00605   0x1fc6, 0x1fcc,
00606   0x1fd0, 0x1fd3,
00607   0x1fd6, 0x1fdb,
00608   0x1fe0, 0x1fec,
00609   0x1ff2, 0x1ff4,
00610   0x1ff6, 0x1ffc,
00611   0x2071, 0x2071,
00612   0x207f, 0x207f,
00613   0x20d0, 0x20ea,
00614   0x2102, 0x2102,
00615   0x2107, 0x2107,
00616   0x210a, 0x2113,
00617   0x2115, 0x2115,
00618   0x2119, 0x211d,
00619   0x2124, 0x2124,
00620   0x2126, 0x2126,
00621   0x2128, 0x2128,
00622   0x212a, 0x212d,
00623   0x212f, 0x2131,
00624   0x2133, 0x2139,
00625   0x213d, 0x213f,
00626   0x2145, 0x2149,
00627   0x3005, 0x3006,
00628   0x302a, 0x302f,
00629   0x3031, 0x3035,
00630   0x303b, 0x303c,
00631   0x3041, 0x3096,
00632   0x3099, 0x309a,
00633   0x309d, 0x309f,
00634   0x30a1, 0x30fa,
00635   0x30fc, 0x30ff,
00636   0x3105, 0x312c,
00637   0x3131, 0x318e,
00638   0x31a0, 0x31b7,
00639   0x31f0, 0x31ff,
00640   0x3400, 0x4db5,
00641   0x4e00, 0x9fa5,
00642   0xa000, 0xa48c,
00643   0xac00, 0xd7a3,
00644   0xf900, 0xfa2d,
00645   0xfa30, 0xfa6a,
00646   0xfb00, 0xfb06,
00647   0xfb13, 0xfb17,
00648   0xfb1d, 0xfb28,
00649   0xfb2a, 0xfb36,
00650   0xfb38, 0xfb3c,
00651   0xfb3e, 0xfb3e,
00652   0xfb40, 0xfb41,
00653   0xfb43, 0xfb44,
00654   0xfb46, 0xfbb1,
00655   0xfbd3, 0xfd3d,
00656   0xfd50, 0xfd8f,
00657   0xfd92, 0xfdc7,
00658   0xfdf0, 0xfdfb,
00659   0xfe00, 0xfe0f,
00660   0xfe20, 0xfe23,
00661   0xfe70, 0xfe74,
00662   0xfe76, 0xfefc,
00663   0xff10, 0xff19,
00664   0xff21, 0xff3a,
00665   0xff41, 0xff5a,
00666   0xff66, 0xffbe,
00667   0xffc2, 0xffc7,
00668   0xffca, 0xffcf,
00669   0xffd2, 0xffd7,
00670   0xffda, 0xffdc,
00671   0x10000, 0x1000b,
00672   0x1000d, 0x10026,
00673   0x10028, 0x1003a,
00674   0x1003c, 0x1003d,
00675   0x1003f, 0x1004d,
00676   0x10050, 0x1005d,
00677   0x10080, 0x100fa,
00678   0x10300, 0x1031e,
00679   0x10330, 0x10349,
00680   0x10380, 0x1039d,
00681   0x10400, 0x1049d,
00682   0x104a0, 0x104a9,
00683   0x10800, 0x10805,
00684   0x10808, 0x10808,
00685   0x1080a, 0x10835,
00686   0x10837, 0x10838,
00687   0x1083c, 0x1083c,
00688   0x1083f, 0x1083f,
00689   0x1d165, 0x1d169,
00690   0x1d16d, 0x1d172,
00691   0x1d17b, 0x1d182,
00692   0x1d185, 0x1d18b,
00693   0x1d1aa, 0x1d1ad,
00694   0x1d400, 0x1d454,
00695   0x1d456, 0x1d49c,
00696   0x1d49e, 0x1d49f,
00697   0x1d4a2, 0x1d4a2,
00698   0x1d4a5, 0x1d4a6,
00699   0x1d4a9, 0x1d4ac,
00700   0x1d4ae, 0x1d4b9,
00701   0x1d4bb, 0x1d4bb,
00702   0x1d4bd, 0x1d4c3,
00703   0x1d4c5, 0x1d505,
00704   0x1d507, 0x1d50a,
00705   0x1d50d, 0x1d514,
00706   0x1d516, 0x1d51c,
00707   0x1d51e, 0x1d539,
00708   0x1d53b, 0x1d53e,
00709   0x1d540, 0x1d544,
00710   0x1d546, 0x1d546,
00711   0x1d54a, 0x1d550,
00712   0x1d552, 0x1d6a3,
00713   0x1d6a8, 0x1d6c0,
00714   0x1d6c2, 0x1d6da,
00715   0x1d6dc, 0x1d6fa,
00716   0x1d6fc, 0x1d714,
00717   0x1d716, 0x1d734,
00718   0x1d736, 0x1d74e,
00719   0x1d750, 0x1d76e,
00720   0x1d770, 0x1d788,
00721   0x1d78a, 0x1d7a8,
00722   0x1d7aa, 0x1d7c2,
00723   0x1d7c4, 0x1d7c9,
00724   0x1d7ce, 0x1d7ff,
00725   0x20000, 0x2a6d6,
00726   0x2f800, 0x2fa1d,
00727   0xe0100, 0xe01ef
00728 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
00729 }; /* end of MBAlnum */
00730 
00731 static const OnigCodePoint SBAlpha[] = {
00732   2,
00733   0x0041, 0x005a,
00734   0x0061, 0x007a
00735 };
00736 
00737 static const OnigCodePoint MBAlpha[] = {
00738 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
00739   394,
00740 #else
00741   6,
00742 #endif
00743   0x00aa, 0x00aa,
00744   0x00b5, 0x00b5,
00745   0x00ba, 0x00ba,
00746   0x00c0, 0x00d6,
00747   0x00d8, 0x00f6,
00748   0x00f8, 0x0236
00749 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
00750   ,
00751   0x0250, 0x02c1,
00752   0x02c6, 0x02d1,
00753   0x02e0, 0x02e4,
00754   0x02ee, 0x02ee,
00755   0x0300, 0x0357,
00756   0x035d, 0x036f,
00757   0x037a, 0x037a,
00758   0x0386, 0x0386,
00759   0x0388, 0x038a,
00760   0x038c, 0x038c,
00761   0x038e, 0x03a1,
00762   0x03a3, 0x03ce,
00763   0x03d0, 0x03f5,
00764   0x03f7, 0x03fb,
00765   0x0400, 0x0481,
00766   0x0483, 0x0486,
00767   0x0488, 0x04ce,
00768   0x04d0, 0x04f5,
00769   0x04f8, 0x04f9,
00770   0x0500, 0x050f,
00771   0x0531, 0x0556,
00772   0x0559, 0x0559,
00773   0x0561, 0x0587,
00774   0x0591, 0x05a1,
00775   0x05a3, 0x05b9,
00776   0x05bb, 0x05bd,
00777   0x05bf, 0x05bf,
00778   0x05c1, 0x05c2,
00779   0x05c4, 0x05c4,
00780   0x05d0, 0x05ea,
00781   0x05f0, 0x05f2,
00782   0x0610, 0x0615,
00783   0x0621, 0x063a,
00784   0x0640, 0x0658,
00785   0x066e, 0x06d3,
00786   0x06d5, 0x06dc,
00787   0x06de, 0x06e8,
00788   0x06ea, 0x06ef,
00789   0x06fa, 0x06fc,
00790   0x06ff, 0x06ff,
00791   0x0710, 0x074a,
00792   0x074d, 0x074f,
00793   0x0780, 0x07b1,
00794   0x0901, 0x0939,
00795   0x093c, 0x094d,
00796   0x0950, 0x0954,
00797   0x0958, 0x0963,
00798   0x0981, 0x0983,
00799   0x0985, 0x098c,
00800   0x098f, 0x0990,
00801   0x0993, 0x09a8,
00802   0x09aa, 0x09b0,
00803   0x09b2, 0x09b2,
00804   0x09b6, 0x09b9,
00805   0x09bc, 0x09c4,
00806   0x09c7, 0x09c8,
00807   0x09cb, 0x09cd,
00808   0x09d7, 0x09d7,
00809   0x09dc, 0x09dd,
00810   0x09df, 0x09e3,
00811   0x09f0, 0x09f1,
00812   0x0a01, 0x0a03,
00813   0x0a05, 0x0a0a,
00814   0x0a0f, 0x0a10,
00815   0x0a13, 0x0a28,
00816   0x0a2a, 0x0a30,
00817   0x0a32, 0x0a33,
00818   0x0a35, 0x0a36,
00819   0x0a38, 0x0a39,
00820   0x0a3c, 0x0a3c,
00821   0x0a3e, 0x0a42,
00822   0x0a47, 0x0a48,
00823   0x0a4b, 0x0a4d,
00824   0x0a59, 0x0a5c,
00825   0x0a5e, 0x0a5e,
00826   0x0a70, 0x0a74,
00827   0x0a81, 0x0a83,
00828   0x0a85, 0x0a8d,
00829   0x0a8f, 0x0a91,
00830   0x0a93, 0x0aa8,
00831   0x0aaa, 0x0ab0,
00832   0x0ab2, 0x0ab3,
00833   0x0ab5, 0x0ab9,
00834   0x0abc, 0x0ac5,
00835   0x0ac7, 0x0ac9,
00836   0x0acb, 0x0acd,
00837   0x0ad0, 0x0ad0,
00838   0x0ae0, 0x0ae3,
00839   0x0b01, 0x0b03,
00840   0x0b05, 0x0b0c,
00841   0x0b0f, 0x0b10,
00842   0x0b13, 0x0b28,
00843   0x0b2a, 0x0b30,
00844   0x0b32, 0x0b33,
00845   0x0b35, 0x0b39,
00846   0x0b3c, 0x0b43,
00847   0x0b47, 0x0b48,
00848   0x0b4b, 0x0b4d,
00849   0x0b56, 0x0b57,
00850   0x0b5c, 0x0b5d,
00851   0x0b5f, 0x0b61,
00852   0x0b71, 0x0b71,
00853   0x0b82, 0x0b83,
00854   0x0b85, 0x0b8a,
00855   0x0b8e, 0x0b90,
00856   0x0b92, 0x0b95,
00857   0x0b99, 0x0b9a,
00858   0x0b9c, 0x0b9c,
00859   0x0b9e, 0x0b9f,
00860   0x0ba3, 0x0ba4,
00861   0x0ba8, 0x0baa,
00862   0x0bae, 0x0bb5,
00863   0x0bb7, 0x0bb9,
00864   0x0bbe, 0x0bc2,
00865   0x0bc6, 0x0bc8,
00866   0x0bca, 0x0bcd,
00867   0x0bd7, 0x0bd7,
00868   0x0c01, 0x0c03,
00869   0x0c05, 0x0c0c,
00870   0x0c0e, 0x0c10,
00871   0x0c12, 0x0c28,
00872   0x0c2a, 0x0c33,
00873   0x0c35, 0x0c39,
00874   0x0c3e, 0x0c44,
00875   0x0c46, 0x0c48,
00876   0x0c4a, 0x0c4d,
00877   0x0c55, 0x0c56,
00878   0x0c60, 0x0c61,
00879   0x0c82, 0x0c83,
00880   0x0c85, 0x0c8c,
00881   0x0c8e, 0x0c90,
00882   0x0c92, 0x0ca8,
00883   0x0caa, 0x0cb3,
00884   0x0cb5, 0x0cb9,
00885   0x0cbc, 0x0cc4,
00886   0x0cc6, 0x0cc8,
00887   0x0cca, 0x0ccd,
00888   0x0cd5, 0x0cd6,
00889   0x0cde, 0x0cde,
00890   0x0ce0, 0x0ce1,
00891   0x0d02, 0x0d03,
00892   0x0d05, 0x0d0c,
00893   0x0d0e, 0x0d10,
00894   0x0d12, 0x0d28,
00895   0x0d2a, 0x0d39,
00896   0x0d3e, 0x0d43,
00897   0x0d46, 0x0d48,
00898   0x0d4a, 0x0d4d,
00899   0x0d57, 0x0d57,
00900   0x0d60, 0x0d61,
00901   0x0d82, 0x0d83,
00902   0x0d85, 0x0d96,
00903   0x0d9a, 0x0db1,
00904   0x0db3, 0x0dbb,
00905   0x0dbd, 0x0dbd,
00906   0x0dc0, 0x0dc6,
00907   0x0dca, 0x0dca,
00908   0x0dcf, 0x0dd4,
00909   0x0dd6, 0x0dd6,
00910   0x0dd8, 0x0ddf,
00911   0x0df2, 0x0df3,
00912   0x0e01, 0x0e3a,
00913   0x0e40, 0x0e4e,
00914   0x0e81, 0x0e82,
00915   0x0e84, 0x0e84,
00916   0x0e87, 0x0e88,
00917   0x0e8a, 0x0e8a,
00918   0x0e8d, 0x0e8d,
00919   0x0e94, 0x0e97,
00920   0x0e99, 0x0e9f,
00921   0x0ea1, 0x0ea3,
00922   0x0ea5, 0x0ea5,
00923   0x0ea7, 0x0ea7,
00924   0x0eaa, 0x0eab,
00925   0x0ead, 0x0eb9,
00926   0x0ebb, 0x0ebd,
00927   0x0ec0, 0x0ec4,
00928   0x0ec6, 0x0ec6,
00929   0x0ec8, 0x0ecd,
00930   0x0edc, 0x0edd,
00931   0x0f00, 0x0f00,
00932   0x0f18, 0x0f19,
00933   0x0f35, 0x0f35,
00934   0x0f37, 0x0f37,
00935   0x0f39, 0x0f39,
00936   0x0f3e, 0x0f47,
00937   0x0f49, 0x0f6a,
00938   0x0f71, 0x0f84,
00939   0x0f86, 0x0f8b,
00940   0x0f90, 0x0f97,
00941   0x0f99, 0x0fbc,
00942   0x0fc6, 0x0fc6,
00943   0x1000, 0x1021,
00944   0x1023, 0x1027,
00945   0x1029, 0x102a,
00946   0x102c, 0x1032,
00947   0x1036, 0x1039,
00948   0x1050, 0x1059,
00949   0x10a0, 0x10c5,
00950   0x10d0, 0x10f8,
00951   0x1100, 0x1159,
00952   0x115f, 0x11a2,
00953   0x11a8, 0x11f9,
00954   0x1200, 0x1206,
00955   0x1208, 0x1246,
00956   0x1248, 0x1248,
00957   0x124a, 0x124d,
00958   0x1250, 0x1256,
00959   0x1258, 0x1258,
00960   0x125a, 0x125d,
00961   0x1260, 0x1286,
00962   0x1288, 0x1288,
00963   0x128a, 0x128d,
00964   0x1290, 0x12ae,
00965   0x12b0, 0x12b0,
00966   0x12b2, 0x12b5,
00967   0x12b8, 0x12be,
00968   0x12c0, 0x12c0,
00969   0x12c2, 0x12c5,
00970   0x12c8, 0x12ce,
00971   0x12d0, 0x12d6,
00972   0x12d8, 0x12ee,
00973   0x12f0, 0x130e,
00974   0x1310, 0x1310,
00975   0x1312, 0x1315,
00976   0x1318, 0x131e,
00977   0x1320, 0x1346,
00978   0x1348, 0x135a,
00979   0x13a0, 0x13f4,
00980   0x1401, 0x166c,
00981   0x166f, 0x1676,
00982   0x1681, 0x169a,
00983   0x16a0, 0x16ea,
00984   0x1700, 0x170c,
00985   0x170e, 0x1714,
00986   0x1720, 0x1734,
00987   0x1740, 0x1753,
00988   0x1760, 0x176c,
00989   0x176e, 0x1770,
00990   0x1772, 0x1773,
00991   0x1780, 0x17b3,
00992   0x17b6, 0x17d3,
00993   0x17d7, 0x17d7,
00994   0x17dc, 0x17dd,
00995   0x180b, 0x180d,
00996   0x1820, 0x1877,
00997   0x1880, 0x18a9,
00998   0x1900, 0x191c,
00999   0x1920, 0x192b,
01000   0x1930, 0x193b,
01001   0x1950, 0x196d,
01002   0x1970, 0x1974,
01003   0x1d00, 0x1d6b,
01004   0x1e00, 0x1e9b,
01005   0x1ea0, 0x1ef9,
01006   0x1f00, 0x1f15,
01007   0x1f18, 0x1f1d,
01008   0x1f20, 0x1f45,
01009   0x1f48, 0x1f4d,
01010   0x1f50, 0x1f57,
01011   0x1f59, 0x1f59,
01012   0x1f5b, 0x1f5b,
01013   0x1f5d, 0x1f5d,
01014   0x1f5f, 0x1f7d,
01015   0x1f80, 0x1fb4,
01016   0x1fb6, 0x1fbc,
01017   0x1fbe, 0x1fbe,
01018   0x1fc2, 0x1fc4,
01019   0x1fc6, 0x1fcc,
01020   0x1fd0, 0x1fd3,
01021   0x1fd6, 0x1fdb,
01022   0x1fe0, 0x1fec,
01023   0x1ff2, 0x1ff4,
01024   0x1ff6, 0x1ffc,
01025   0x2071, 0x2071,
01026   0x207f, 0x207f,
01027   0x20d0, 0x20ea,
01028   0x2102, 0x2102,
01029   0x2107, 0x2107,
01030   0x210a, 0x2113,
01031   0x2115, 0x2115,
01032   0x2119, 0x211d,
01033   0x2124, 0x2124,
01034   0x2126, 0x2126,
01035   0x2128, 0x2128,
01036   0x212a, 0x212d,
01037   0x212f, 0x2131,
01038   0x2133, 0x2139,
01039   0x213d, 0x213f,
01040   0x2145, 0x2149,
01041   0x3005, 0x3006,
01042   0x302a, 0x302f,
01043   0x3031, 0x3035,
01044   0x303b, 0x303c,
01045   0x3041, 0x3096,
01046   0x3099, 0x309a,
01047   0x309d, 0x309f,
01048   0x30a1, 0x30fa,
01049   0x30fc, 0x30ff,
01050   0x3105, 0x312c,
01051   0x3131, 0x318e,
01052   0x31a0, 0x31b7,
01053   0x31f0, 0x31ff,
01054   0x3400, 0x4db5,
01055   0x4e00, 0x9fa5,
01056   0xa000, 0xa48c,
01057   0xac00, 0xd7a3,
01058   0xf900, 0xfa2d,
01059   0xfa30, 0xfa6a,
01060   0xfb00, 0xfb06,
01061   0xfb13, 0xfb17,
01062   0xfb1d, 0xfb28,
01063   0xfb2a, 0xfb36,
01064   0xfb38, 0xfb3c,
01065   0xfb3e, 0xfb3e,
01066   0xfb40, 0xfb41,
01067   0xfb43, 0xfb44,
01068   0xfb46, 0xfbb1,
01069   0xfbd3, 0xfd3d,
01070   0xfd50, 0xfd8f,
01071   0xfd92, 0xfdc7,
01072   0xfdf0, 0xfdfb,
01073   0xfe00, 0xfe0f,
01074   0xfe20, 0xfe23,
01075   0xfe70, 0xfe74,
01076   0xfe76, 0xfefc,
01077   0xff21, 0xff3a,
01078   0xff41, 0xff5a,
01079   0xff66, 0xffbe,
01080   0xffc2, 0xffc7,
01081   0xffca, 0xffcf,
01082   0xffd2, 0xffd7,
01083   0xffda, 0xffdc,
01084   0x10000, 0x1000b,
01085   0x1000d, 0x10026,
01086   0x10028, 0x1003a,
01087   0x1003c, 0x1003d,
01088   0x1003f, 0x1004d,
01089   0x10050, 0x1005d,
01090   0x10080, 0x100fa,
01091   0x10300, 0x1031e,
01092   0x10330, 0x10349,
01093   0x10380, 0x1039d,
01094   0x10400, 0x1049d,
01095   0x10800, 0x10805,
01096   0x10808, 0x10808,
01097   0x1080a, 0x10835,
01098   0x10837, 0x10838,
01099   0x1083c, 0x1083c,
01100   0x1083f, 0x1083f,
01101   0x1d165, 0x1d169,
01102   0x1d16d, 0x1d172,
01103   0x1d17b, 0x1d182,
01104   0x1d185, 0x1d18b,
01105   0x1d1aa, 0x1d1ad,
01106   0x1d400, 0x1d454,
01107   0x1d456, 0x1d49c,
01108   0x1d49e, 0x1d49f,
01109   0x1d4a2, 0x1d4a2,
01110   0x1d4a5, 0x1d4a6,
01111   0x1d4a9, 0x1d4ac,
01112   0x1d4ae, 0x1d4b9,
01113   0x1d4bb, 0x1d4bb,
01114   0x1d4bd, 0x1d4c3,
01115   0x1d4c5, 0x1d505,
01116   0x1d507, 0x1d50a,
01117   0x1d50d, 0x1d514,
01118   0x1d516, 0x1d51c,
01119   0x1d51e, 0x1d539,
01120   0x1d53b, 0x1d53e,
01121   0x1d540, 0x1d544,
01122   0x1d546, 0x1d546,
01123   0x1d54a, 0x1d550,
01124   0x1d552, 0x1d6a3,
01125   0x1d6a8, 0x1d6c0,
01126   0x1d6c2, 0x1d6da,
01127   0x1d6dc, 0x1d6fa,
01128   0x1d6fc, 0x1d714,
01129   0x1d716, 0x1d734,
01130   0x1d736, 0x1d74e,
01131   0x1d750, 0x1d76e,
01132   0x1d770, 0x1d788,
01133   0x1d78a, 0x1d7a8,
01134   0x1d7aa, 0x1d7c2,
01135   0x1d7c4, 0x1d7c9,
01136   0x20000, 0x2a6d6,
01137   0x2f800, 0x2fa1d,
01138   0xe0100, 0xe01ef
01139 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
01140 }; /* end of MBAlpha */
01141 
01142 static const OnigCodePoint SBBlank[] = {
01143   2,
01144   0x0009, 0x0009,
01145   0x0020, 0x0020
01146 };
01147 
01148 static const OnigCodePoint MBBlank[] = {
01149 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01150   7,
01151 #else
01152   1,
01153 #endif
01154   0x00a0, 0x00a0
01155 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01156   ,
01157   0x1680, 0x1680,
01158   0x180e, 0x180e,
01159   0x2000, 0x200a,
01160   0x202f, 0x202f,
01161   0x205f, 0x205f,
01162   0x3000, 0x3000
01163 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
01164 }; /* end of MBBlank */
01165 
01166 static const OnigCodePoint SBCntrl[] = {
01167   2,
01168   0x0000, 0x001f,
01169   0x007f, 0x007f
01170 };
01171 
01172 static const OnigCodePoint MBCntrl[] = {
01173 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01174   18,
01175 #else
01176   2,
01177 #endif
01178   0x0080, 0x009f,
01179   0x00ad, 0x00ad
01180 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01181   ,
01182   0x0600, 0x0603,
01183   0x06dd, 0x06dd,
01184   0x070f, 0x070f,
01185   0x17b4, 0x17b5,
01186   0x200b, 0x200f,
01187   0x202a, 0x202e,
01188   0x2060, 0x2063,
01189   0x206a, 0x206f,
01190   0xd800, 0xf8ff,
01191   0xfeff, 0xfeff,
01192   0xfff9, 0xfffb,
01193   0x1d173, 0x1d17a,
01194   0xe0001, 0xe0001,
01195   0xe0020, 0xe007f,
01196   0xf0000, 0xffffd,
01197   0x100000, 0x10fffd
01198 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
01199 }; /* end of MBCntrl */
01200 
01201 static const OnigCodePoint SBDigit[] = {
01202   1,
01203   0x0030, 0x0039
01204 };
01205 
01206 static const OnigCodePoint MBDigit[] = {
01207 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01208   22,
01209 #else
01210   0
01211 #endif
01212 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01213   0x0660, 0x0669,
01214   0x06f0, 0x06f9,
01215   0x0966, 0x096f,
01216   0x09e6, 0x09ef,
01217   0x0a66, 0x0a6f,
01218   0x0ae6, 0x0aef,
01219   0x0b66, 0x0b6f,
01220   0x0be7, 0x0bef,
01221   0x0c66, 0x0c6f,
01222   0x0ce6, 0x0cef,
01223   0x0d66, 0x0d6f,
01224   0x0e50, 0x0e59,
01225   0x0ed0, 0x0ed9,
01226   0x0f20, 0x0f29,
01227   0x1040, 0x1049,
01228   0x1369, 0x1371,
01229   0x17e0, 0x17e9,
01230   0x1810, 0x1819,
01231   0x1946, 0x194f,
01232   0xff10, 0xff19,
01233   0x104a0, 0x104a9,
01234   0x1d7ce, 0x1d7ff
01235 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
01236 }; /* end of MBDigit */
01237 
01238 static const OnigCodePoint SBGraph[] = {
01239   1,
01240   0x0021, 0x007e
01241 };
01242 
01243 static const OnigCodePoint MBGraph[] = {
01244 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01245   404,
01246 #else
01247   1,
01248 #endif
01249   0x00a1, 0x0236
01250 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01251   ,
01252   0x0250, 0x0357,
01253   0x035d, 0x036f,
01254   0x0374, 0x0375,
01255   0x037a, 0x037a,
01256   0x037e, 0x037e,
01257   0x0384, 0x038a,
01258   0x038c, 0x038c,
01259   0x038e, 0x03a1,
01260   0x03a3, 0x03ce,
01261   0x03d0, 0x03fb,
01262   0x0400, 0x0486,
01263   0x0488, 0x04ce,
01264   0x04d0, 0x04f5,
01265   0x04f8, 0x04f9,
01266   0x0500, 0x050f,
01267   0x0531, 0x0556,
01268   0x0559, 0x055f,
01269   0x0561, 0x0587,
01270   0x0589, 0x058a,
01271   0x0591, 0x05a1,
01272   0x05a3, 0x05b9,
01273   0x05bb, 0x05c4,
01274   0x05d0, 0x05ea,
01275   0x05f0, 0x05f4,
01276   0x0600, 0x0603,
01277   0x060c, 0x0615,
01278   0x061b, 0x061b,
01279   0x061f, 0x061f,
01280   0x0621, 0x063a,
01281   0x0640, 0x0658,
01282   0x0660, 0x070d,
01283   0x070f, 0x074a,
01284   0x074d, 0x074f,
01285   0x0780, 0x07b1,
01286   0x0901, 0x0939,
01287   0x093c, 0x094d,
01288   0x0950, 0x0954,
01289   0x0958, 0x0970,
01290   0x0981, 0x0983,
01291   0x0985, 0x098c,
01292   0x098f, 0x0990,
01293   0x0993, 0x09a8,
01294   0x09aa, 0x09b0,
01295   0x09b2, 0x09b2,
01296   0x09b6, 0x09b9,
01297   0x09bc, 0x09c4,
01298   0x09c7, 0x09c8,
01299   0x09cb, 0x09cd,
01300   0x09d7, 0x09d7,
01301   0x09dc, 0x09dd,
01302   0x09df, 0x09e3,
01303   0x09e6, 0x09fa,
01304   0x0a01, 0x0a03,
01305   0x0a05, 0x0a0a,
01306   0x0a0f, 0x0a10,
01307   0x0a13, 0x0a28,
01308   0x0a2a, 0x0a30,
01309   0x0a32, 0x0a33,
01310   0x0a35, 0x0a36,
01311   0x0a38, 0x0a39,
01312   0x0a3c, 0x0a3c,
01313   0x0a3e, 0x0a42,
01314   0x0a47, 0x0a48,
01315   0x0a4b, 0x0a4d,
01316   0x0a59, 0x0a5c,
01317   0x0a5e, 0x0a5e,
01318   0x0a66, 0x0a74,
01319   0x0a81, 0x0a83,
01320   0x0a85, 0x0a8d,
01321   0x0a8f, 0x0a91,
01322   0x0a93, 0x0aa8,
01323   0x0aaa, 0x0ab0,
01324   0x0ab2, 0x0ab3,
01325   0x0ab5, 0x0ab9,
01326   0x0abc, 0x0ac5,
01327   0x0ac7, 0x0ac9,
01328   0x0acb, 0x0acd,
01329   0x0ad0, 0x0ad0,
01330   0x0ae0, 0x0ae3,
01331   0x0ae6, 0x0aef,
01332   0x0af1, 0x0af1,
01333   0x0b01, 0x0b03,
01334   0x0b05, 0x0b0c,
01335   0x0b0f, 0x0b10,
01336   0x0b13, 0x0b28,
01337   0x0b2a, 0x0b30,
01338   0x0b32, 0x0b33,
01339   0x0b35, 0x0b39,
01340   0x0b3c, 0x0b43,
01341   0x0b47, 0x0b48,
01342   0x0b4b, 0x0b4d,
01343   0x0b56, 0x0b57,
01344   0x0b5c, 0x0b5d,
01345   0x0b5f, 0x0b61,
01346   0x0b66, 0x0b71,
01347   0x0b82, 0x0b83,
01348   0x0b85, 0x0b8a,
01349   0x0b8e, 0x0b90,
01350   0x0b92, 0x0b95,
01351   0x0b99, 0x0b9a,
01352   0x0b9c, 0x0b9c,
01353   0x0b9e, 0x0b9f,
01354   0x0ba3, 0x0ba4,
01355   0x0ba8, 0x0baa,
01356   0x0bae, 0x0bb5,
01357   0x0bb7, 0x0bb9,
01358   0x0bbe, 0x0bc2,
01359   0x0bc6, 0x0bc8,
01360   0x0bca, 0x0bcd,
01361   0x0bd7, 0x0bd7,
01362   0x0be7, 0x0bfa,
01363   0x0c01, 0x0c03,
01364   0x0c05, 0x0c0c,
01365   0x0c0e, 0x0c10,
01366   0x0c12, 0x0c28,
01367   0x0c2a, 0x0c33,
01368   0x0c35, 0x0c39,
01369   0x0c3e, 0x0c44,
01370   0x0c46, 0x0c48,
01371   0x0c4a, 0x0c4d,
01372   0x0c55, 0x0c56,
01373   0x0c60, 0x0c61,
01374   0x0c66, 0x0c6f,
01375   0x0c82, 0x0c83,
01376   0x0c85, 0x0c8c,
01377   0x0c8e, 0x0c90,
01378   0x0c92, 0x0ca8,
01379   0x0caa, 0x0cb3,
01380   0x0cb5, 0x0cb9,
01381   0x0cbc, 0x0cc4,
01382   0x0cc6, 0x0cc8,
01383   0x0cca, 0x0ccd,
01384   0x0cd5, 0x0cd6,
01385   0x0cde, 0x0cde,
01386   0x0ce0, 0x0ce1,
01387   0x0ce6, 0x0cef,
01388   0x0d02, 0x0d03,
01389   0x0d05, 0x0d0c,
01390   0x0d0e, 0x0d10,
01391   0x0d12, 0x0d28,
01392   0x0d2a, 0x0d39,
01393   0x0d3e, 0x0d43,
01394   0x0d46, 0x0d48,
01395   0x0d4a, 0x0d4d,
01396   0x0d57, 0x0d57,
01397   0x0d60, 0x0d61,
01398   0x0d66, 0x0d6f,
01399   0x0d82, 0x0d83,
01400   0x0d85, 0x0d96,
01401   0x0d9a, 0x0db1,
01402   0x0db3, 0x0dbb,
01403   0x0dbd, 0x0dbd,
01404   0x0dc0, 0x0dc6,
01405   0x0dca, 0x0dca,
01406   0x0dcf, 0x0dd4,
01407   0x0dd6, 0x0dd6,
01408   0x0dd8, 0x0ddf,
01409   0x0df2, 0x0df4,
01410   0x0e01, 0x0e3a,
01411   0x0e3f, 0x0e5b,
01412   0x0e81, 0x0e82,
01413   0x0e84, 0x0e84,
01414   0x0e87, 0x0e88,
01415   0x0e8a, 0x0e8a,
01416   0x0e8d, 0x0e8d,
01417   0x0e94, 0x0e97,
01418   0x0e99, 0x0e9f,
01419   0x0ea1, 0x0ea3,
01420   0x0ea5, 0x0ea5,
01421   0x0ea7, 0x0ea7,
01422   0x0eaa, 0x0eab,
01423   0x0ead, 0x0eb9,
01424   0x0ebb, 0x0ebd,
01425   0x0ec0, 0x0ec4,
01426   0x0ec6, 0x0ec6,
01427   0x0ec8, 0x0ecd,
01428   0x0ed0, 0x0ed9,
01429   0x0edc, 0x0edd,
01430   0x0f00, 0x0f47,
01431   0x0f49, 0x0f6a,
01432   0x0f71, 0x0f8b,
01433   0x0f90, 0x0f97,
01434   0x0f99, 0x0fbc,
01435   0x0fbe, 0x0fcc,
01436   0x0fcf, 0x0fcf,
01437   0x1000, 0x1021,
01438   0x1023, 0x1027,
01439   0x1029, 0x102a,
01440   0x102c, 0x1032,
01441   0x1036, 0x1039,
01442   0x1040, 0x1059,
01443   0x10a0, 0x10c5,
01444   0x10d0, 0x10f8,
01445   0x10fb, 0x10fb,
01446   0x1100, 0x1159,
01447   0x115f, 0x11a2,
01448   0x11a8, 0x11f9,
01449   0x1200, 0x1206,
01450   0x1208, 0x1246,
01451   0x1248, 0x1248,
01452   0x124a, 0x124d,
01453   0x1250, 0x1256,
01454   0x1258, 0x1258,
01455   0x125a, 0x125d,
01456   0x1260, 0x1286,
01457   0x1288, 0x1288,
01458   0x128a, 0x128d,
01459   0x1290, 0x12ae,
01460   0x12b0, 0x12b0,
01461   0x12b2, 0x12b5,
01462   0x12b8, 0x12be,
01463   0x12c0, 0x12c0,
01464   0x12c2, 0x12c5,
01465   0x12c8, 0x12ce,
01466   0x12d0, 0x12d6,
01467   0x12d8, 0x12ee,
01468   0x12f0, 0x130e,
01469   0x1310, 0x1310,
01470   0x1312, 0x1315,
01471   0x1318, 0x131e,
01472   0x1320, 0x1346,
01473   0x1348, 0x135a,
01474   0x1361, 0x137c,
01475   0x13a0, 0x13f4,
01476   0x1401, 0x1676,
01477   0x1681, 0x169c,
01478   0x16a0, 0x16f0,
01479   0x1700, 0x170c,
01480   0x170e, 0x1714,
01481   0x1720, 0x1736,
01482   0x1740, 0x1753,
01483   0x1760, 0x176c,
01484   0x176e, 0x1770,
01485   0x1772, 0x1773,
01486   0x1780, 0x17dd,
01487   0x17e0, 0x17e9,
01488   0x17f0, 0x17f9,
01489   0x1800, 0x180d,
01490   0x1810, 0x1819,
01491   0x1820, 0x1877,
01492   0x1880, 0x18a9,
01493   0x1900, 0x191c,
01494   0x1920, 0x192b,
01495   0x1930, 0x193b,
01496   0x1940, 0x1940,
01497   0x1944, 0x196d,
01498   0x1970, 0x1974,
01499   0x19e0, 0x19ff,
01500   0x1d00, 0x1d6b,
01501   0x1e00, 0x1e9b,
01502   0x1ea0, 0x1ef9,
01503   0x1f00, 0x1f15,
01504   0x1f18, 0x1f1d,
01505   0x1f20, 0x1f45,
01506   0x1f48, 0x1f4d,
01507   0x1f50, 0x1f57,
01508   0x1f59, 0x1f59,
01509   0x1f5b, 0x1f5b,
01510   0x1f5d, 0x1f5d,
01511   0x1f5f, 0x1f7d,
01512   0x1f80, 0x1fb4,
01513   0x1fb6, 0x1fc4,
01514   0x1fc6, 0x1fd3,
01515   0x1fd6, 0x1fdb,
01516   0x1fdd, 0x1fef,
01517   0x1ff2, 0x1ff4,
01518   0x1ff6, 0x1ffe,
01519   0x200b, 0x2027,
01520   0x202a, 0x202e,
01521   0x2030, 0x2054,
01522   0x2057, 0x2057,
01523   0x2060, 0x2063,
01524   0x206a, 0x2071,
01525   0x2074, 0x208e,
01526   0x20a0, 0x20b1,
01527   0x20d0, 0x20ea,
01528   0x2100, 0x213b,
01529   0x213d, 0x214b,
01530   0x2153, 0x2183,
01531   0x2190, 0x23d0,
01532   0x2400, 0x2426,
01533   0x2440, 0x244a,
01534   0x2460, 0x2617,
01535   0x2619, 0x267d,
01536   0x2680, 0x2691,
01537   0x26a0, 0x26a1,
01538   0x2701, 0x2704,
01539   0x2706, 0x2709,
01540   0x270c, 0x2727,
01541   0x2729, 0x274b,
01542   0x274d, 0x274d,
01543   0x274f, 0x2752,
01544   0x2756, 0x2756,
01545   0x2758, 0x275e,
01546   0x2761, 0x2794,
01547   0x2798, 0x27af,
01548   0x27b1, 0x27be,
01549   0x27d0, 0x27eb,
01550   0x27f0, 0x2b0d,
01551   0x2e80, 0x2e99,
01552   0x2e9b, 0x2ef3,
01553   0x2f00, 0x2fd5,
01554   0x2ff0, 0x2ffb,
01555   0x3001, 0x303f,
01556   0x3041, 0x3096,
01557   0x3099, 0x30ff,
01558   0x3105, 0x312c,
01559   0x3131, 0x318e,
01560   0x3190, 0x31b7,
01561   0x31f0, 0x321e,
01562   0x3220, 0x3243,
01563   0x3250, 0x327d,
01564   0x327f, 0x32fe,
01565   0x3300, 0x4db5,
01566   0x4dc0, 0x9fa5,
01567   0xa000, 0xa48c,
01568   0xa490, 0xa4c6,
01569   0xac00, 0xd7a3,
01570   0xe000, 0xfa2d,
01571   0xfa30, 0xfa6a,
01572   0xfb00, 0xfb06,
01573   0xfb13, 0xfb17,
01574   0xfb1d, 0xfb36,
01575   0xfb38, 0xfb3c,
01576   0xfb3e, 0xfb3e,
01577   0xfb40, 0xfb41,
01578   0xfb43, 0xfb44,
01579   0xfb46, 0xfbb1,
01580   0xfbd3, 0xfd3f,
01581   0xfd50, 0xfd8f,
01582   0xfd92, 0xfdc7,
01583   0xfdf0, 0xfdfd,
01584   0xfe00, 0xfe0f,
01585   0xfe20, 0xfe23,
01586   0xfe30, 0xfe52,
01587   0xfe54, 0xfe66,
01588   0xfe68, 0xfe6b,
01589   0xfe70, 0xfe74,
01590   0xfe76, 0xfefc,
01591   0xfeff, 0xfeff,
01592   0xff01, 0xffbe,
01593   0xffc2, 0xffc7,
01594   0xffca, 0xffcf,
01595   0xffd2, 0xffd7,
01596   0xffda, 0xffdc,
01597   0xffe0, 0xffe6,
01598   0xffe8, 0xffee,
01599   0xfff9, 0xfffd,
01600   0x10000, 0x1000b,
01601   0x1000d, 0x10026,
01602   0x10028, 0x1003a,
01603   0x1003c, 0x1003d,
01604   0x1003f, 0x1004d,
01605   0x10050, 0x1005d,
01606   0x10080, 0x100fa,
01607   0x10100, 0x10102,
01608   0x10107, 0x10133,
01609   0x10137, 0x1013f,
01610   0x10300, 0x1031e,
01611   0x10320, 0x10323,
01612   0x10330, 0x1034a,
01613   0x10380, 0x1039d,
01614   0x1039f, 0x1039f,
01615   0x10400, 0x1049d,
01616   0x104a0, 0x104a9,
01617   0x10800, 0x10805,
01618   0x10808, 0x10808,
01619   0x1080a, 0x10835,
01620   0x10837, 0x10838,
01621   0x1083c, 0x1083c,
01622   0x1083f, 0x1083f,
01623   0x1d000, 0x1d0f5,
01624   0x1d100, 0x1d126,
01625   0x1d12a, 0x1d1dd,
01626   0x1d300, 0x1d356,
01627   0x1d400, 0x1d454,
01628   0x1d456, 0x1d49c,
01629   0x1d49e, 0x1d49f,
01630   0x1d4a2, 0x1d4a2,
01631   0x1d4a5, 0x1d4a6,
01632   0x1d4a9, 0x1d4ac,
01633   0x1d4ae, 0x1d4b9,
01634   0x1d4bb, 0x1d4bb,
01635   0x1d4bd, 0x1d4c3,
01636   0x1d4c5, 0x1d505,
01637   0x1d507, 0x1d50a,
01638   0x1d50d, 0x1d514,
01639   0x1d516, 0x1d51c,
01640   0x1d51e, 0x1d539,
01641   0x1d53b, 0x1d53e,
01642   0x1d540, 0x1d544,
01643   0x1d546, 0x1d546,
01644   0x1d54a, 0x1d550,
01645   0x1d552, 0x1d6a3,
01646   0x1d6a8, 0x1d7c9,
01647   0x1d7ce, 0x1d7ff,
01648   0x20000, 0x2a6d6,
01649   0x2f800, 0x2fa1d,
01650   0xe0001, 0xe0001,
01651   0xe0020, 0xe007f,
01652   0xe0100, 0xe01ef,
01653   0xf0000, 0xffffd,
01654   0x100000, 0x10fffd
01655 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
01656 }; /* end of MBGraph */
01657 
01658 static const OnigCodePoint SBLower[] = {
01659   1,
01660   0x0061, 0x007a
01661 };
01662 
01663 static const OnigCodePoint MBLower[] = {
01664 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01665   423,
01666 #else
01667   5,
01668 #endif
01669   0x00aa, 0x00aa,
01670   0x00b5, 0x00b5,
01671   0x00ba, 0x00ba,
01672   0x00df, 0x00f6,
01673   0x00f8, 0x00ff
01674 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
01675   ,
01676   0x0101, 0x0101,
01677   0x0103, 0x0103,
01678   0x0105, 0x0105,
01679   0x0107, 0x0107,
01680   0x0109, 0x0109,
01681   0x010b, 0x010b,
01682   0x010d, 0x010d,
01683   0x010f, 0x010f,
01684   0x0111, 0x0111,
01685   0x0113, 0x0113,
01686   0x0115, 0x0115,
01687   0x0117, 0x0117,
01688   0x0119, 0x0119,
01689   0x011b, 0x011b,
01690   0x011d, 0x011d,
01691   0x011f, 0x011f,
01692   0x0121, 0x0121,
01693   0x0123, 0x0123,
01694   0x0125, 0x0125,
01695   0x0127, 0x0127,
01696   0x0129, 0x0129,
01697   0x012b, 0x012b,
01698   0x012d, 0x012d,
01699   0x012f, 0x012f,
01700   0x0131, 0x0131,
01701   0x0133, 0x0133,
01702   0x0135, 0x0135,
01703   0x0137, 0x0138,
01704   0x013a, 0x013a,
01705   0x013c, 0x013c,
01706   0x013e, 0x013e,
01707   0x0140, 0x0140,
01708   0x0142, 0x0142,
01709   0x0144, 0x0144,
01710   0x0146, 0x0146,
01711   0x0148, 0x0149,
01712   0x014b, 0x014b,
01713   0x014d, 0x014d,
01714   0x014f, 0x014f,
01715   0x0151, 0x0151,
01716   0x0153, 0x0153,
01717   0x0155, 0x0155,
01718   0x0157, 0x0157,
01719   0x0159, 0x0159,
01720   0x015b, 0x015b,
01721   0x015d, 0x015d,
01722   0x015f, 0x015f,
01723   0x0161, 0x0161,
01724   0x0163, 0x0163,
01725   0x0165, 0x0165,
01726   0x0167, 0x0167,
01727   0x0169, 0x0169,
01728   0x016b, 0x016b,
01729   0x016d, 0x016d,
01730   0x016f, 0x016f,
01731   0x0171, 0x0171,
01732   0x0173, 0x0173,
01733   0x0175, 0x0175,
01734   0x0177, 0x0177,
01735   0x017a, 0x017a,
01736   0x017c, 0x017c,
01737   0x017e, 0x0180,
01738   0x0183, 0x0183,
01739   0x0185, 0x0185,
01740   0x0188, 0x0188,
01741   0x018c, 0x018d,
01742   0x0192, 0x0192,
01743   0x0195, 0x0195,
01744   0x0199, 0x019b,
01745   0x019e, 0x019e,
01746   0x01a1, 0x01a1,
01747   0x01a3, 0x01a3,
01748   0x01a5, 0x01a5,
01749   0x01a8, 0x01a8,
01750   0x01aa, 0x01ab,
01751   0x01ad, 0x01ad,
01752   0x01b0, 0x01b0,
01753   0x01b4, 0x01b4,
01754   0x01b6, 0x01b6,
01755   0x01b9, 0x01ba,
01756   0x01bd, 0x01bf,
01757   0x01c6, 0x01c6,
01758   0x01c9, 0x01c9,
01759   0x01cc, 0x01cc,
01760   0x01ce, 0x01ce,
01761   0x01d0, 0x01d0,
01762   0x01d2, 0x01d2,
01763   0x01d4, 0x01d4,
01764   0x01d6, 0x01d6,
01765   0x01d8, 0x01d8,
01766   0x01da, 0x01da,
01767   0x01dc, 0x01dd,
01768   0x01df, 0x01df,
01769   0x01e1, 0x01e1,
01770   0x01e3, 0x01e3,
01771   0x01e5, 0x01e5,
01772   0x01e7, 0x01e7,
01773   0x01e9, 0x01e9,
01774   0x01eb, 0x01eb,
01775   0x01ed, 0x01ed,
01776   0x01ef, 0x01f0,
01777   0x01f3, 0x01f3,
01778   0x01f5, 0x01f5,
01779   0x01f9, 0x01f9,
01780   0x01fb, 0x01fb,
01781   0x01fd, 0x01fd,
01782   0x01ff, 0x01ff,
01783   0x0201, 0x0201,
01784   0x0203, 0x0203,
01785   0x0205, 0x0205,
01786   0x0207, 0x0207,
01787   0x0209, 0x0209,
01788   0x020b, 0x020b,
01789   0x020d, 0x020d,
01790   0x020f, 0x020f,
01791   0x0211, 0x0211,
01792   0x0213, 0x0213,
01793   0x0215, 0x0215,
01794   0x0217, 0x0217,
01795   0x0219, 0x0219,
01796   0x021b, 0x021b,
01797   0x021d, 0x021d,
01798   0x021f, 0x021f,
01799   0x0221, 0x0221,
01800   0x0223, 0x0223,
01801   0x0225, 0x0225,
01802   0x0227, 0x0227,
01803   0x0229, 0x0229,
01804   0x022b, 0x022b,
01805   0x022d, 0x022d,
01806   0x022f, 0x022f,
01807   0x0231, 0x0231,
01808   0x0233, 0x0236,
01809   0x0250, 0x02af,
01810   0x0390, 0x0390,
01811   0x03ac, 0x03ce,
01812   0x03d0, 0x03d1,
01813   0x03d5, 0x03d7,
01814   0x03d9, 0x03d9,
01815   0x03db, 0x03db,
01816   0x03dd, 0x03dd,
01817   0x03df, 0x03df,
01818   0x03e1, 0x03e1,
01819   0x03e3, 0x03e3,
01820   0x03e5, 0x03e5,
01821   0x03e7, 0x03e7,
01822   0x03e9, 0x03e9,
01823   0x03eb, 0x03eb,
01824   0x03ed, 0x03ed,
01825   0x03ef, 0x03f3,
01826   0x03f5, 0x03f5,
01827   0x03f8, 0x03f8,
01828   0x03fb, 0x03fb,
01829   0x0430, 0x045f,
01830   0x0461, 0x0461,
01831   0x0463, 0x0463,
01832   0x0465, 0x0465,
01833   0x0467, 0x0467,
01834   0x0469, 0x0469,
01835   0x046b, 0x046b,
01836   0x046d, 0x046d,
01837   0x046f, 0x046f,
01838   0x0471, 0x0471,
01839   0x0473, 0x0473,
01840   0x0475, 0x0475,
01841   0x0477, 0x0477,
01842   0x0479, 0x0479,
01843   0x047b, 0x047b,
01844   0x047d, 0x047d,
01845   0x047f, 0x047f,
01846   0x0481, 0x0481,
01847   0x048b, 0x048b,
01848   0x048d, 0x048d,
01849   0x048f, 0x048f,
01850   0x0491, 0x0491,
01851   0x0493, 0x0493,
01852   0x0495, 0x0495,
01853   0x0497, 0x0497,
01854   0x0499, 0x0499,
01855   0x049b, 0x049b,
01856   0x049d, 0x049d,
01857   0x049f, 0x049f,
01858   0x04a1, 0x04a1,
01859   0x04a3, 0x04a3,
01860   0x04a5, 0x04a5,
01861   0x04a7, 0x04a7,
01862   0x04a9, 0x04a9,
01863   0x04ab, 0x04ab,
01864   0x04ad, 0x04ad,
01865   0x04af, 0x04af,
01866   0x04b1, 0x04b1,
01867   0x04b3, 0x04b3,
01868   0x04b5, 0x04b5,
01869   0x04b7, 0x04b7,
01870   0x04b9, 0x04b9,
01871   0x04bb, 0x04bb,
01872   0x04bd, 0x04bd,
01873   0x04bf, 0x04bf,
01874   0x04c2, 0x04c2,
01875   0x04c4, 0x04c4,
01876   0x04c6, 0x04c6,
01877   0x04c8, 0x04c8,
01878   0x04ca, 0x04ca,
01879   0x04cc, 0x04cc,
01880   0x04ce, 0x04ce,
01881   0x04d1, 0x04d1,
01882   0x04d3, 0x04d3,
01883   0x04d5, 0x04d5,
01884   0x04d7, 0x04d7,
01885   0x04d9, 0x04d9,
01886   0x04db, 0x04db,
01887   0x04dd, 0x04dd,
01888   0x04df, 0x04df,
01889   0x04e1, 0x04e1,
01890   0x04e3, 0x04e3,
01891   0x04e5, 0x04e5,
01892   0x04e7, 0x04e7,
01893   0x04e9, 0x04e9,
01894   0x04eb, 0x04eb,
01895   0x04ed, 0x04ed,
01896   0x04ef, 0x04ef,
01897   0x04f1, 0x04f1,
01898   0x04f3, 0x04f3,
01899   0x04f5, 0x04f5,
01900   0x04f9, 0x04f9,
01901   0x0501, 0x0501,
01902   0x0503, 0x0503,
01903   0x0505, 0x0505,
01904   0x0507, 0x0507,
01905   0x0509, 0x0509,
01906   0x050b, 0x050b,
01907   0x050d, 0x050d,
01908   0x050f, 0x050f,
01909   0x0561, 0x0587,
01910   0x1d00, 0x1d2b,
01911   0x1d62, 0x1d6b,
01912   0x1e01, 0x1e01,
01913   0x1e03, 0x1e03,
01914   0x1e05, 0x1e05,
01915   0x1e07, 0x1e07,
01916   0x1e09, 0x1e09,
01917   0x1e0b, 0x1e0b,
01918   0x1e0d, 0x1e0d,
01919   0x1e0f, 0x1e0f,
01920   0x1e11, 0x1e11,
01921   0x1e13, 0x1e13,
01922   0x1e15, 0x1e15,
01923   0x1e17, 0x1e17,
01924   0x1e19, 0x1e19,
01925   0x1e1b, 0x1e1b,
01926   0x1e1d, 0x1e1d,
01927   0x1e1f, 0x1e1f,
01928   0x1e21, 0x1e21,
01929   0x1e23, 0x1e23,
01930   0x1e25, 0x1e25,
01931   0x1e27, 0x1e27,
01932   0x1e29, 0x1e29,
01933   0x1e2b, 0x1e2b,
01934   0x1e2d, 0x1e2d,
01935   0x1e2f, 0x1e2f,
01936   0x1e31, 0x1e31,
01937   0x1e33, 0x1e33,
01938   0x1e35, 0x1e35,
01939   0x1e37, 0x1e37,
01940   0x1e39, 0x1e39,
01941   0x1e3b, 0x1e3b,
01942   0x1e3d, 0x1e3d,
01943   0x1e3f, 0x1e3f,
01944   0x1e41, 0x1e41,
01945   0x1e43, 0x1e43,
01946   0x1e45, 0x1e45,
01947   0x1e47, 0x1e47,
01948   0x1e49, 0x1e49,
01949   0x1e4b, 0x1e4b,
01950   0x1e4d, 0x1e4d,
01951   0x1e4f, 0x1e4f,
01952   0x1e51, 0x1e51,
01953   0x1e53, 0x1e53,
01954   0x1e55, 0x1e55,
01955   0x1e57, 0x1e57,
01956   0x1e59, 0x1e59,
01957   0x1e5b, 0x1e5b,
01958   0x1e5d, 0x1e5d,
01959   0x1e5f, 0x1e5f,
01960   0x1e61, 0x1e61,
01961   0x1e63, 0x1e63,
01962   0x1e65, 0x1e65,
01963   0x1e67, 0x1e67,
01964   0x1e69, 0x1e69,
01965   0x1e6b, 0x1e6b,
01966   0x1e6d, 0x1e6d,
01967   0x1e6f, 0x1e6f,
01968   0x1e71, 0x1e71,
01969   0x1e73, 0x1e73,
01970   0x1e75, 0x1e75,
01971   0x1e77, 0x1e77,
01972   0x1e79, 0x1e79,
01973   0x1e7b, 0x1e7b,
01974   0x1e7d, 0x1e7d,
01975   0x1e7f, 0x1e7f,
01976   0x1e81, 0x1e81,
01977   0x1e83, 0x1e83,
01978   0x1e85, 0x1e85,
01979   0x1e87, 0x1e87,
01980   0x1e89, 0x1e89,
01981   0x1e8b, 0x1e8b,
01982   0x1e8d, 0x1e8d,
01983   0x1e8f, 0x1e8f,
01984   0x1e91, 0x1e91,
01985   0x1e93, 0x1e93,
01986   0x1e95, 0x1e9b,
01987   0x1ea1, 0x1ea1,
01988   0x1ea3, 0x1ea3,
01989   0x1ea5, 0x1ea5,
01990   0x1ea7, 0x1ea7,
01991   0x1ea9, 0x1ea9,
01992   0x1eab, 0x1eab,
01993   0x1ead, 0x1ead,
01994   0x1eaf, 0x1eaf,
01995   0x1eb1, 0x1eb1,
01996   0x1eb3, 0x1eb3,
01997   0x1eb5, 0x1eb5,
01998   0x1eb7, 0x1eb7,
01999   0x1eb9, 0x1eb9,
02000   0x1ebb, 0x1ebb,
02001   0x1ebd, 0x1ebd,
02002   0x1ebf, 0x1ebf,
02003   0x1ec1, 0x1ec1,
02004   0x1ec3, 0x1ec3,
02005   0x1ec5, 0x1ec5,
02006   0x1ec7, 0x1ec7,
02007   0x1ec9, 0x1ec9,
02008   0x1ecb, 0x1ecb,
02009   0x1ecd, 0x1ecd,
02010   0x1ecf, 0x1ecf,
02011   0x1ed1, 0x1ed1,
02012   0x1ed3, 0x1ed3,
02013   0x1ed5, 0x1ed5,
02014   0x1ed7, 0x1ed7,
02015   0x1ed9, 0x1ed9,
02016   0x1edb, 0x1edb,
02017   0x1edd, 0x1edd,
02018   0x1edf, 0x1edf,
02019   0x1ee1, 0x1ee1,
02020   0x1ee3, 0x1ee3,
02021   0x1ee5, 0x1ee5,
02022   0x1ee7, 0x1ee7,
02023   0x1ee9, 0x1ee9,
02024   0x1eeb, 0x1eeb,
02025   0x1eed, 0x1eed,
02026   0x1eef, 0x1eef,
02027   0x1ef1, 0x1ef1,
02028   0x1ef3, 0x1ef3,
02029   0x1ef5, 0x1ef5,
02030   0x1ef7, 0x1ef7,
02031   0x1ef9, 0x1ef9,
02032   0x1f00, 0x1f07,
02033   0x1f10, 0x1f15,
02034   0x1f20, 0x1f27,
02035   0x1f30, 0x1f37,
02036   0x1f40, 0x1f45,
02037   0x1f50, 0x1f57,
02038   0x1f60, 0x1f67,
02039   0x1f70, 0x1f7d,
02040   0x1f80, 0x1f87,
02041   0x1f90, 0x1f97,
02042   0x1fa0, 0x1fa7,
02043   0x1fb0, 0x1fb4,
02044   0x1fb6, 0x1fb7,
02045   0x1fbe, 0x1fbe,
02046   0x1fc2, 0x1fc4,
02047   0x1fc6, 0x1fc7,
02048   0x1fd0, 0x1fd3,
02049   0x1fd6, 0x1fd7,
02050   0x1fe0, 0x1fe7,
02051   0x1ff2, 0x1ff4,
02052   0x1ff6, 0x1ff7,
02053   0x2071, 0x2071,
02054   0x207f, 0x207f,
02055   0x210a, 0x210a,
02056   0x210e, 0x210f,
02057   0x2113, 0x2113,
02058   0x212f, 0x212f,
02059   0x2134, 0x2134,
02060   0x2139, 0x2139,
02061   0x213d, 0x213d,
02062   0x2146, 0x2149,
02063   0xfb00, 0xfb06,
02064   0xfb13, 0xfb17,
02065   0xff41, 0xff5a,
02066   0x10428, 0x1044f,
02067   0x1d41a, 0x1d433,
02068   0x1d44e, 0x1d454,
02069   0x1d456, 0x1d467,
02070   0x1d482, 0x1d49b,
02071   0x1d4b6, 0x1d4b9,
02072   0x1d4bb, 0x1d4bb,
02073   0x1d4bd, 0x1d4c3,
02074   0x1d4c5, 0x1d4cf,
02075   0x1d4ea, 0x1d503,
02076   0x1d51e, 0x1d537,
02077   0x1d552, 0x1d56b,
02078   0x1d586, 0x1d59f,
02079   0x1d5ba, 0x1d5d3,
02080   0x1d5ee, 0x1d607,
02081   0x1d622, 0x1d63b,
02082   0x1d656, 0x1d66f,
02083   0x1d68a, 0x1d6a3,
02084   0x1d6c2, 0x1d6da,
02085   0x1d6dc, 0x1d6e1,
02086   0x1d6fc, 0x1d714,
02087   0x1d716, 0x1d71b,
02088   0x1d736, 0x1d74e,
02089   0x1d750, 0x1d755,
02090   0x1d770, 0x1d788,
02091   0x1d78a, 0x1d78f,
02092   0x1d7aa, 0x1d7c2,
02093   0x1d7c4, 0x1d7c9
02094 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
02095 }; /* end of MBLower */
02096 
02097 static const OnigCodePoint SBPrint[] = {
02098   2,
02099   0x0009, 0x000d,
02100   0x0020, 0x007e
02101 };
02102 
02103 static const OnigCodePoint MBPrint[] = {
02104 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02105   403,
02106 #else
02107   2,
02108 #endif
02109   0x0085, 0x0085,
02110   0x00a0, 0x0236
02111 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02112   ,
02113   0x0250, 0x0357,
02114   0x035d, 0x036f,
02115   0x0374, 0x0375,
02116   0x037a, 0x037a,
02117   0x037e, 0x037e,
02118   0x0384, 0x038a,
02119   0x038c, 0x038c,
02120   0x038e, 0x03a1,
02121   0x03a3, 0x03ce,
02122   0x03d0, 0x03fb,
02123   0x0400, 0x0486,
02124   0x0488, 0x04ce,
02125   0x04d0, 0x04f5,
02126   0x04f8, 0x04f9,
02127   0x0500, 0x050f,
02128   0x0531, 0x0556,
02129   0x0559, 0x055f,
02130   0x0561, 0x0587,
02131   0x0589, 0x058a,
02132   0x0591, 0x05a1,
02133   0x05a3, 0x05b9,
02134   0x05bb, 0x05c4,
02135   0x05d0, 0x05ea,
02136   0x05f0, 0x05f4,
02137   0x0600, 0x0603,
02138   0x060c, 0x0615,
02139   0x061b, 0x061b,
02140   0x061f, 0x061f,
02141   0x0621, 0x063a,
02142   0x0640, 0x0658,
02143   0x0660, 0x070d,
02144   0x070f, 0x074a,
02145   0x074d, 0x074f,
02146   0x0780, 0x07b1,
02147   0x0901, 0x0939,
02148   0x093c, 0x094d,
02149   0x0950, 0x0954,
02150   0x0958, 0x0970,
02151   0x0981, 0x0983,
02152   0x0985, 0x098c,
02153   0x098f, 0x0990,
02154   0x0993, 0x09a8,
02155   0x09aa, 0x09b0,
02156   0x09b2, 0x09b2,
02157   0x09b6, 0x09b9,
02158   0x09bc, 0x09c4,
02159   0x09c7, 0x09c8,
02160   0x09cb, 0x09cd,
02161   0x09d7, 0x09d7,
02162   0x09dc, 0x09dd,
02163   0x09df, 0x09e3,
02164   0x09e6, 0x09fa,
02165   0x0a01, 0x0a03,
02166   0x0a05, 0x0a0a,
02167   0x0a0f, 0x0a10,
02168   0x0a13, 0x0a28,
02169   0x0a2a, 0x0a30,
02170   0x0a32, 0x0a33,
02171   0x0a35, 0x0a36,
02172   0x0a38, 0x0a39,
02173   0x0a3c, 0x0a3c,
02174   0x0a3e, 0x0a42,
02175   0x0a47, 0x0a48,
02176   0x0a4b, 0x0a4d,
02177   0x0a59, 0x0a5c,
02178   0x0a5e, 0x0a5e,
02179   0x0a66, 0x0a74,
02180   0x0a81, 0x0a83,
02181   0x0a85, 0x0a8d,
02182   0x0a8f, 0x0a91,
02183   0x0a93, 0x0aa8,
02184   0x0aaa, 0x0ab0,
02185   0x0ab2, 0x0ab3,
02186   0x0ab5, 0x0ab9,
02187   0x0abc, 0x0ac5,
02188   0x0ac7, 0x0ac9,
02189   0x0acb, 0x0acd,
02190   0x0ad0, 0x0ad0,
02191   0x0ae0, 0x0ae3,
02192   0x0ae6, 0x0aef,
02193   0x0af1, 0x0af1,
02194   0x0b01, 0x0b03,
02195   0x0b05, 0x0b0c,
02196   0x0b0f, 0x0b10,
02197   0x0b13, 0x0b28,
02198   0x0b2a, 0x0b30,
02199   0x0b32, 0x0b33,
02200   0x0b35, 0x0b39,
02201   0x0b3c, 0x0b43,
02202   0x0b47, 0x0b48,
02203   0x0b4b, 0x0b4d,
02204   0x0b56, 0x0b57,
02205   0x0b5c, 0x0b5d,
02206   0x0b5f, 0x0b61,
02207   0x0b66, 0x0b71,
02208   0x0b82, 0x0b83,
02209   0x0b85, 0x0b8a,
02210   0x0b8e, 0x0b90,
02211   0x0b92, 0x0b95,
02212   0x0b99, 0x0b9a,
02213   0x0b9c, 0x0b9c,
02214   0x0b9e, 0x0b9f,
02215   0x0ba3, 0x0ba4,
02216   0x0ba8, 0x0baa,
02217   0x0bae, 0x0bb5,
02218   0x0bb7, 0x0bb9,
02219   0x0bbe, 0x0bc2,
02220   0x0bc6, 0x0bc8,
02221   0x0bca, 0x0bcd,
02222   0x0bd7, 0x0bd7,
02223   0x0be7, 0x0bfa,
02224   0x0c01, 0x0c03,
02225   0x0c05, 0x0c0c,
02226   0x0c0e, 0x0c10,
02227   0x0c12, 0x0c28,
02228   0x0c2a, 0x0c33,
02229   0x0c35, 0x0c39,
02230   0x0c3e, 0x0c44,
02231   0x0c46, 0x0c48,
02232   0x0c4a, 0x0c4d,
02233   0x0c55, 0x0c56,
02234   0x0c60, 0x0c61,
02235   0x0c66, 0x0c6f,
02236   0x0c82, 0x0c83,
02237   0x0c85, 0x0c8c,
02238   0x0c8e, 0x0c90,
02239   0x0c92, 0x0ca8,
02240   0x0caa, 0x0cb3,
02241   0x0cb5, 0x0cb9,
02242   0x0cbc, 0x0cc4,
02243   0x0cc6, 0x0cc8,
02244   0x0cca, 0x0ccd,
02245   0x0cd5, 0x0cd6,
02246   0x0cde, 0x0cde,
02247   0x0ce0, 0x0ce1,
02248   0x0ce6, 0x0cef,
02249   0x0d02, 0x0d03,
02250   0x0d05, 0x0d0c,
02251   0x0d0e, 0x0d10,
02252   0x0d12, 0x0d28,
02253   0x0d2a, 0x0d39,
02254   0x0d3e, 0x0d43,
02255   0x0d46, 0x0d48,
02256   0x0d4a, 0x0d4d,
02257   0x0d57, 0x0d57,
02258   0x0d60, 0x0d61,
02259   0x0d66, 0x0d6f,
02260   0x0d82, 0x0d83,
02261   0x0d85, 0x0d96,
02262   0x0d9a, 0x0db1,
02263   0x0db3, 0x0dbb,
02264   0x0dbd, 0x0dbd,
02265   0x0dc0, 0x0dc6,
02266   0x0dca, 0x0dca,
02267   0x0dcf, 0x0dd4,
02268   0x0dd6, 0x0dd6,
02269   0x0dd8, 0x0ddf,
02270   0x0df2, 0x0df4,
02271   0x0e01, 0x0e3a,
02272   0x0e3f, 0x0e5b,
02273   0x0e81, 0x0e82,
02274   0x0e84, 0x0e84,
02275   0x0e87, 0x0e88,
02276   0x0e8a, 0x0e8a,
02277   0x0e8d, 0x0e8d,
02278   0x0e94, 0x0e97,
02279   0x0e99, 0x0e9f,
02280   0x0ea1, 0x0ea3,
02281   0x0ea5, 0x0ea5,
02282   0x0ea7, 0x0ea7,
02283   0x0eaa, 0x0eab,
02284   0x0ead, 0x0eb9,
02285   0x0ebb, 0x0ebd,
02286   0x0ec0, 0x0ec4,
02287   0x0ec6, 0x0ec6,
02288   0x0ec8, 0x0ecd,
02289   0x0ed0, 0x0ed9,
02290   0x0edc, 0x0edd,
02291   0x0f00, 0x0f47,
02292   0x0f49, 0x0f6a,
02293   0x0f71, 0x0f8b,
02294   0x0f90, 0x0f97,
02295   0x0f99, 0x0fbc,
02296   0x0fbe, 0x0fcc,
02297   0x0fcf, 0x0fcf,
02298   0x1000, 0x1021,
02299   0x1023, 0x1027,
02300   0x1029, 0x102a,
02301   0x102c, 0x1032,
02302   0x1036, 0x1039,
02303   0x1040, 0x1059,
02304   0x10a0, 0x10c5,
02305   0x10d0, 0x10f8,
02306   0x10fb, 0x10fb,
02307   0x1100, 0x1159,
02308   0x115f, 0x11a2,
02309   0x11a8, 0x11f9,
02310   0x1200, 0x1206,
02311   0x1208, 0x1246,
02312   0x1248, 0x1248,
02313   0x124a, 0x124d,
02314   0x1250, 0x1256,
02315   0x1258, 0x1258,
02316   0x125a, 0x125d,
02317   0x1260, 0x1286,
02318   0x1288, 0x1288,
02319   0x128a, 0x128d,
02320   0x1290, 0x12ae,
02321   0x12b0, 0x12b0,
02322   0x12b2, 0x12b5,
02323   0x12b8, 0x12be,
02324   0x12c0, 0x12c0,
02325   0x12c2, 0x12c5,
02326   0x12c8, 0x12ce,
02327   0x12d0, 0x12d6,
02328   0x12d8, 0x12ee,
02329   0x12f0, 0x130e,
02330   0x1310, 0x1310,
02331   0x1312, 0x1315,
02332   0x1318, 0x131e,
02333   0x1320, 0x1346,
02334   0x1348, 0x135a,
02335   0x1361, 0x137c,
02336   0x13a0, 0x13f4,
02337   0x1401, 0x1676,
02338   0x1680, 0x169c,
02339   0x16a0, 0x16f0,
02340   0x1700, 0x170c,
02341   0x170e, 0x1714,
02342   0x1720, 0x1736,
02343   0x1740, 0x1753,
02344   0x1760, 0x176c,
02345   0x176e, 0x1770,
02346   0x1772, 0x1773,
02347   0x1780, 0x17dd,
02348   0x17e0, 0x17e9,
02349   0x17f0, 0x17f9,
02350   0x1800, 0x180e,
02351   0x1810, 0x1819,
02352   0x1820, 0x1877,
02353   0x1880, 0x18a9,
02354   0x1900, 0x191c,
02355   0x1920, 0x192b,
02356   0x1930, 0x193b,
02357   0x1940, 0x1940,
02358   0x1944, 0x196d,
02359   0x1970, 0x1974,
02360   0x19e0, 0x19ff,
02361   0x1d00, 0x1d6b,
02362   0x1e00, 0x1e9b,
02363   0x1ea0, 0x1ef9,
02364   0x1f00, 0x1f15,
02365   0x1f18, 0x1f1d,
02366   0x1f20, 0x1f45,
02367   0x1f48, 0x1f4d,
02368   0x1f50, 0x1f57,
02369   0x1f59, 0x1f59,
02370   0x1f5b, 0x1f5b,
02371   0x1f5d, 0x1f5d,
02372   0x1f5f, 0x1f7d,
02373   0x1f80, 0x1fb4,
02374   0x1fb6, 0x1fc4,
02375   0x1fc6, 0x1fd3,
02376   0x1fd6, 0x1fdb,
02377   0x1fdd, 0x1fef,
02378   0x1ff2, 0x1ff4,
02379   0x1ff6, 0x1ffe,
02380   0x2000, 0x2054,
02381   0x2057, 0x2057,
02382   0x205f, 0x2063,
02383   0x206a, 0x2071,
02384   0x2074, 0x208e,
02385   0x20a0, 0x20b1,
02386   0x20d0, 0x20ea,
02387   0x2100, 0x213b,
02388   0x213d, 0x214b,
02389   0x2153, 0x2183,
02390   0x2190, 0x23d0,
02391   0x2400, 0x2426,
02392   0x2440, 0x244a,
02393   0x2460, 0x2617,
02394   0x2619, 0x267d,
02395   0x2680, 0x2691,
02396   0x26a0, 0x26a1,
02397   0x2701, 0x2704,
02398   0x2706, 0x2709,
02399   0x270c, 0x2727,
02400   0x2729, 0x274b,
02401   0x274d, 0x274d,
02402   0x274f, 0x2752,
02403   0x2756, 0x2756,
02404   0x2758, 0x275e,
02405   0x2761, 0x2794,
02406   0x2798, 0x27af,
02407   0x27b1, 0x27be,
02408   0x27d0, 0x27eb,
02409   0x27f0, 0x2b0d,
02410   0x2e80, 0x2e99,
02411   0x2e9b, 0x2ef3,
02412   0x2f00, 0x2fd5,
02413   0x2ff0, 0x2ffb,
02414   0x3000, 0x303f,
02415   0x3041, 0x3096,
02416   0x3099, 0x30ff,
02417   0x3105, 0x312c,
02418   0x3131, 0x318e,
02419   0x3190, 0x31b7,
02420   0x31f0, 0x321e,
02421   0x3220, 0x3243,
02422   0x3250, 0x327d,
02423   0x327f, 0x32fe,
02424   0x3300, 0x4db5,
02425   0x4dc0, 0x9fa5,
02426   0xa000, 0xa48c,
02427   0xa490, 0xa4c6,
02428   0xac00, 0xd7a3,
02429   0xe000, 0xfa2d,
02430   0xfa30, 0xfa6a,
02431   0xfb00, 0xfb06,
02432   0xfb13, 0xfb17,
02433   0xfb1d, 0xfb36,
02434   0xfb38, 0xfb3c,
02435   0xfb3e, 0xfb3e,
02436   0xfb40, 0xfb41,
02437   0xfb43, 0xfb44,
02438   0xfb46, 0xfbb1,
02439   0xfbd3, 0xfd3f,
02440   0xfd50, 0xfd8f,
02441   0xfd92, 0xfdc7,
02442   0xfdf0, 0xfdfd,
02443   0xfe00, 0xfe0f,
02444   0xfe20, 0xfe23,
02445   0xfe30, 0xfe52,
02446   0xfe54, 0xfe66,
02447   0xfe68, 0xfe6b,
02448   0xfe70, 0xfe74,
02449   0xfe76, 0xfefc,
02450   0xfeff, 0xfeff,
02451   0xff01, 0xffbe,
02452   0xffc2, 0xffc7,
02453   0xffca, 0xffcf,
02454   0xffd2, 0xffd7,
02455   0xffda, 0xffdc,
02456   0xffe0, 0xffe6,
02457   0xffe8, 0xffee,
02458   0xfff9, 0xfffd,
02459   0x10000, 0x1000b,
02460   0x1000d, 0x10026,
02461   0x10028, 0x1003a,
02462   0x1003c, 0x1003d,
02463   0x1003f, 0x1004d,
02464   0x10050, 0x1005d,
02465   0x10080, 0x100fa,
02466   0x10100, 0x10102,
02467   0x10107, 0x10133,
02468   0x10137, 0x1013f,
02469   0x10300, 0x1031e,
02470   0x10320, 0x10323,
02471   0x10330, 0x1034a,
02472   0x10380, 0x1039d,
02473   0x1039f, 0x1039f,
02474   0x10400, 0x1049d,
02475   0x104a0, 0x104a9,
02476   0x10800, 0x10805,
02477   0x10808, 0x10808,
02478   0x1080a, 0x10835,
02479   0x10837, 0x10838,
02480   0x1083c, 0x1083c,
02481   0x1083f, 0x1083f,
02482   0x1d000, 0x1d0f5,
02483   0x1d100, 0x1d126,
02484   0x1d12a, 0x1d1dd,
02485   0x1d300, 0x1d356,
02486   0x1d400, 0x1d454,
02487   0x1d456, 0x1d49c,
02488   0x1d49e, 0x1d49f,
02489   0x1d4a2, 0x1d4a2,
02490   0x1d4a5, 0x1d4a6,
02491   0x1d4a9, 0x1d4ac,
02492   0x1d4ae, 0x1d4b9,
02493   0x1d4bb, 0x1d4bb,
02494   0x1d4bd, 0x1d4c3,
02495   0x1d4c5, 0x1d505,
02496   0x1d507, 0x1d50a,
02497   0x1d50d, 0x1d514,
02498   0x1d516, 0x1d51c,
02499   0x1d51e, 0x1d539,
02500   0x1d53b, 0x1d53e,
02501   0x1d540, 0x1d544,
02502   0x1d546, 0x1d546,
02503   0x1d54a, 0x1d550,
02504   0x1d552, 0x1d6a3,
02505   0x1d6a8, 0x1d7c9,
02506   0x1d7ce, 0x1d7ff,
02507   0x20000, 0x2a6d6,
02508   0x2f800, 0x2fa1d,
02509   0xe0001, 0xe0001,
02510   0xe0020, 0xe007f,
02511   0xe0100, 0xe01ef,
02512   0xf0000, 0xffffd,
02513   0x100000, 0x10fffd
02514 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
02515 }; /* end of MBPrint */
02516 
02517 static const OnigCodePoint SBPunct[] = {
02518   9,
02519   0x0021, 0x0023,
02520   0x0025, 0x002a,
02521   0x002c, 0x002f,
02522   0x003a, 0x003b,
02523   0x003f, 0x0040,
02524   0x005b, 0x005d,
02525   0x005f, 0x005f,
02526   0x007b, 0x007b,
02527   0x007d, 0x007d
02528 }; /* end of SBPunct */
02529 
02530 static const OnigCodePoint MBPunct[] = {
02531 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02532   77,
02533 #else
02534   5,
02535 #endif
02536   0x00a1, 0x00a1,
02537   0x00ab, 0x00ab,
02538   0x00b7, 0x00b7,
02539   0x00bb, 0x00bb,
02540   0x00bf, 0x00bf
02541 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02542   ,
02543   0x037e, 0x037e,
02544   0x0387, 0x0387,
02545   0x055a, 0x055f,
02546   0x0589, 0x058a,
02547   0x05be, 0x05be,
02548   0x05c0, 0x05c0,
02549   0x05c3, 0x05c3,
02550   0x05f3, 0x05f4,
02551   0x060c, 0x060d,
02552   0x061b, 0x061b,
02553   0x061f, 0x061f,
02554   0x066a, 0x066d,
02555   0x06d4, 0x06d4,
02556   0x0700, 0x070d,
02557   0x0964, 0x0965,
02558   0x0970, 0x0970,
02559   0x0df4, 0x0df4,
02560   0x0e4f, 0x0e4f,
02561   0x0e5a, 0x0e5b,
02562   0x0f04, 0x0f12,
02563   0x0f3a, 0x0f3d,
02564   0x0f85, 0x0f85,
02565   0x104a, 0x104f,
02566   0x10fb, 0x10fb,
02567   0x1361, 0x1368,
02568   0x166d, 0x166e,
02569   0x169b, 0x169c,
02570   0x16eb, 0x16ed,
02571   0x1735, 0x1736,
02572   0x17d4, 0x17d6,
02573   0x17d8, 0x17da,
02574   0x1800, 0x180a,
02575   0x1944, 0x1945,
02576   0x2010, 0x2027,
02577   0x2030, 0x2043,
02578   0x2045, 0x2051,
02579   0x2053, 0x2054,
02580   0x2057, 0x2057,
02581   0x207d, 0x207e,
02582   0x208d, 0x208e,
02583   0x2329, 0x232a,
02584   0x23b4, 0x23b6,
02585   0x2768, 0x2775,
02586   0x27e6, 0x27eb,
02587   0x2983, 0x2998,
02588   0x29d8, 0x29db,
02589   0x29fc, 0x29fd,
02590   0x3001, 0x3003,
02591   0x3008, 0x3011,
02592   0x3014, 0x301f,
02593   0x3030, 0x3030,
02594   0x303d, 0x303d,
02595   0x30a0, 0x30a0,
02596   0x30fb, 0x30fb,
02597   0xfd3e, 0xfd3f,
02598   0xfe30, 0xfe52,
02599   0xfe54, 0xfe61,
02600   0xfe63, 0xfe63,
02601   0xfe68, 0xfe68,
02602   0xfe6a, 0xfe6b,
02603   0xff01, 0xff03,
02604   0xff05, 0xff0a,
02605   0xff0c, 0xff0f,
02606   0xff1a, 0xff1b,
02607   0xff1f, 0xff20,
02608   0xff3b, 0xff3d,
02609   0xff3f, 0xff3f,
02610   0xff5b, 0xff5b,
02611   0xff5d, 0xff5d,
02612   0xff5f, 0xff65,
02613   0x10100, 0x10101,
02614   0x1039f, 0x1039f
02615 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
02616 }; /* end of MBPunct */
02617 
02618 static const OnigCodePoint SBSpace[] = {
02619   2,
02620   0x0009, 0x000d,
02621   0x0020, 0x0020
02622 };
02623 
02624 static const OnigCodePoint MBSpace[] = {
02625 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02626   9,
02627 #else
02628   2,
02629 #endif
02630   0x0085, 0x0085,
02631   0x00a0, 0x00a0
02632 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02633   ,
02634   0x1680, 0x1680,
02635   0x180e, 0x180e,
02636   0x2000, 0x200a,
02637   0x2028, 0x2029,
02638   0x202f, 0x202f,
02639   0x205f, 0x205f,
02640   0x3000, 0x3000
02641 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
02642 }; /* end of MBSpace */
02643 
02644 static const OnigCodePoint SBUpper[] = {
02645   1,
02646   0x0041, 0x005a
02647 };
02648 
02649 static const OnigCodePoint MBUpper[] = {
02650 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02651   420,
02652 #else
02653   2,
02654 #endif
02655   0x00c0, 0x00d6,
02656   0x00d8, 0x00de
02657 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
02658   ,
02659   0x0100, 0x0100,
02660   0x0102, 0x0102,
02661   0x0104, 0x0104,
02662   0x0106, 0x0106,
02663   0x0108, 0x0108,
02664   0x010a, 0x010a,
02665   0x010c, 0x010c,
02666   0x010e, 0x010e,
02667   0x0110, 0x0110,
02668   0x0112, 0x0112,
02669   0x0114, 0x0114,
02670   0x0116, 0x0116,
02671   0x0118, 0x0118,
02672   0x011a, 0x011a,
02673   0x011c, 0x011c,
02674   0x011e, 0x011e,
02675   0x0120, 0x0120,
02676   0x0122, 0x0122,
02677   0x0124, 0x0124,
02678   0x0126, 0x0126,
02679   0x0128, 0x0128,
02680   0x012a, 0x012a,
02681   0x012c, 0x012c,
02682   0x012e, 0x012e,
02683   0x0130, 0x0130,
02684   0x0132, 0x0132,
02685   0x0134, 0x0134,
02686   0x0136, 0x0136,
02687   0x0139, 0x0139,
02688   0x013b, 0x013b,
02689   0x013d, 0x013d,
02690   0x013f, 0x013f,
02691   0x0141, 0x0141,
02692   0x0143, 0x0143,
02693   0x0145, 0x0145,
02694   0x0147, 0x0147,
02695   0x014a, 0x014a,
02696   0x014c, 0x014c,
02697   0x014e, 0x014e,
02698   0x0150, 0x0150,
02699   0x0152, 0x0152,
02700   0x0154, 0x0154,
02701   0x0156, 0x0156,
02702   0x0158, 0x0158,
02703   0x015a, 0x015a,
02704   0x015c, 0x015c,
02705   0x015e, 0x015e,
02706   0x0160, 0x0160,
02707   0x0162, 0x0162,
02708   0x0164, 0x0164,
02709   0x0166, 0x0166,
02710   0x0168, 0x0168,
02711   0x016a, 0x016a,
02712   0x016c, 0x016c,
02713   0x016e, 0x016e,
02714   0x0170, 0x0170,
02715   0x0172, 0x0172,
02716   0x0174, 0x0174,
02717   0x0176, 0x0176,
02718   0x0178, 0x0179,
02719   0x017b, 0x017b,
02720   0x017d, 0x017d,
02721   0x0181, 0x0182,
02722   0x0184, 0x0184,
02723   0x0186, 0x0187,
02724   0x0189, 0x018b,
02725   0x018e, 0x0191,
02726   0x0193, 0x0194,
02727   0x0196, 0x0198,
02728   0x019c, 0x019d,
02729   0x019f, 0x01a0,
02730   0x01a2, 0x01a2,
02731   0x01a4, 0x01a4,
02732   0x01a6, 0x01a7,
02733   0x01a9, 0x01a9,
02734   0x01ac, 0x01ac,
02735   0x01ae, 0x01af,
02736   0x01b1, 0x01b3,
02737   0x01b5, 0x01b5,
02738   0x01b7, 0x01b8,
02739   0x01bc, 0x01bc,
02740   0x01c4, 0x01c4,
02741   0x01c7, 0x01c7,
02742   0x01ca, 0x01ca,
02743   0x01cd, 0x01cd,
02744   0x01cf, 0x01cf,
02745   0x01d1, 0x01d1,
02746   0x01d3, 0x01d3,
02747   0x01d5, 0x01d5,
02748   0x01d7, 0x01d7,
02749   0x01d9, 0x01d9,
02750   0x01db, 0x01db,
02751   0x01de, 0x01de,
02752   0x01e0, 0x01e0,
02753   0x01e2, 0x01e2,
02754   0x01e4, 0x01e4,
02755   0x01e6, 0x01e6,
02756   0x01e8, 0x01e8,
02757   0x01ea, 0x01ea,
02758   0x01ec, 0x01ec,
02759   0x01ee, 0x01ee,
02760   0x01f1, 0x01f1,
02761   0x01f4, 0x01f4,
02762   0x01f6, 0x01f8,
02763   0x01fa, 0x01fa,
02764   0x01fc, 0x01fc,
02765   0x01fe, 0x01fe,
02766   0x0200, 0x0200,
02767   0x0202, 0x0202,
02768   0x0204, 0x0204,
02769   0x0206, 0x0206,
02770   0x0208, 0x0208,
02771   0x020a, 0x020a,
02772   0x020c, 0x020c,
02773   0x020e, 0x020e,
02774   0x0210, 0x0210,
02775   0x0212, 0x0212,
02776   0x0214, 0x0214,
02777   0x0216, 0x0216,
02778   0x0218, 0x0218,
02779   0x021a, 0x021a,
02780   0x021c, 0x021c,
02781   0x021e, 0x021e,
02782   0x0220, 0x0220,
02783   0x0222, 0x0222,
02784   0x0224, 0x0224,
02785   0x0226, 0x0226,
02786   0x0228, 0x0228,
02787   0x022a, 0x022a,
02788   0x022c, 0x022c,
02789   0x022e, 0x022e,
02790   0x0230, 0x0230,
02791   0x0232, 0x0232,
02792   0x0386, 0x0386,
02793   0x0388, 0x038a,
02794   0x038c, 0x038c,
02795   0x038e, 0x038f,
02796   0x0391, 0x03a1,
02797   0x03a3, 0x03ab,
02798   0x03d2, 0x03d4,
02799   0x03d8, 0x03d8,
02800   0x03da, 0x03da,
02801   0x03dc, 0x03dc,
02802   0x03de, 0x03de,
02803   0x03e0, 0x03e0,
02804   0x03e2, 0x03e2,
02805   0x03e4, 0x03e4,
02806   0x03e6, 0x03e6,
02807   0x03e8, 0x03e8,
02808   0x03ea, 0x03ea,
02809   0x03ec, 0x03ec,
02810   0x03ee, 0x03ee,
02811   0x03f4, 0x03f4,
02812   0x03f7, 0x03f7,
02813   0x03f9, 0x03fa,
02814   0x0400, 0x042f,
02815   0x0460, 0x0460,
02816   0x0462, 0x0462,
02817   0x0464, 0x0464,
02818   0x0466, 0x0466,
02819   0x0468, 0x0468,
02820   0x046a, 0x046a,
02821   0x046c, 0x046c,
02822   0x046e, 0x046e,
02823   0x0470, 0x0470,
02824   0x0472, 0x0472,
02825   0x0474, 0x0474,
02826   0x0476, 0x0476,
02827   0x0478, 0x0478,
02828   0x047a, 0x047a,
02829   0x047c, 0x047c,
02830   0x047e, 0x047e,
02831   0x0480, 0x0480,
02832   0x048a, 0x048a,
02833   0x048c, 0x048c,
02834   0x048e, 0x048e,
02835   0x0490, 0x0490,
02836   0x0492, 0x0492,
02837   0x0494, 0x0494,
02838   0x0496, 0x0496,
02839   0x0498, 0x0498,
02840   0x049a, 0x049a,
02841   0x049c, 0x049c,
02842   0x049e, 0x049e,
02843   0x04a0, 0x04a0,
02844   0x04a2, 0x04a2,
02845   0x04a4, 0x04a4,
02846   0x04a6, 0x04a6,
02847   0x04a8, 0x04a8,
02848   0x04aa, 0x04aa,
02849   0x04ac, 0x04ac,
02850   0x04ae, 0x04ae,
02851   0x04b0, 0x04b0,
02852   0x04b2, 0x04b2,
02853   0x04b4, 0x04b4,
02854   0x04b6, 0x04b6,
02855   0x04b8, 0x04b8,
02856   0x04ba, 0x04ba,
02857   0x04bc, 0x04bc,
02858   0x04be, 0x04be,
02859   0x04c0, 0x04c1,
02860   0x04c3, 0x04c3,
02861   0x04c5, 0x04c5,
02862   0x04c7, 0x04c7,
02863   0x04c9, 0x04c9,
02864   0x04cb, 0x04cb,
02865   0x04cd, 0x04cd,
02866   0x04d0, 0x04d0,
02867   0x04d2, 0x04d2,
02868   0x04d4, 0x04d4,
02869   0x04d6, 0x04d6,
02870   0x04d8, 0x04d8,
02871   0x04da, 0x04da,
02872   0x04dc, 0x04dc,
02873   0x04de, 0x04de,
02874   0x04e0, 0x04e0,
02875   0x04e2, 0x04e2,
02876   0x04e4, 0x04e4,
02877   0x04e6, 0x04e6,
02878   0x04e8, 0x04e8,
02879   0x04ea, 0x04ea,
02880   0x04ec, 0x04ec,
02881   0x04ee, 0x04ee,
02882   0x04f0, 0x04f0,
02883   0x04f2, 0x04f2,
02884   0x04f4, 0x04f4,
02885   0x04f8, 0x04f8,
02886   0x0500, 0x0500,
02887   0x0502, 0x0502,
02888   0x0504, 0x0504,
02889   0x0506, 0x0506,
02890   0x0508, 0x0508,
02891   0x050a, 0x050a,
02892   0x050c, 0x050c,
02893   0x050e, 0x050e,
02894   0x0531, 0x0556,
02895   0x10a0, 0x10c5,
02896   0x1e00, 0x1e00,
02897   0x1e02, 0x1e02,
02898   0x1e04, 0x1e04,
02899   0x1e06, 0x1e06,
02900   0x1e08, 0x1e08,
02901   0x1e0a, 0x1e0a,
02902   0x1e0c, 0x1e0c,
02903   0x1e0e, 0x1e0e,
02904   0x1e10, 0x1e10,
02905   0x1e12, 0x1e12,
02906   0x1e14, 0x1e14,
02907   0x1e16, 0x1e16,
02908   0x1e18, 0x1e18,
02909   0x1e1a, 0x1e1a,
02910   0x1e1c, 0x1e1c,
02911   0x1e1e, 0x1e1e,
02912   0x1e20, 0x1e20,
02913   0x1e22, 0x1e22,
02914   0x1e24, 0x1e24,
02915   0x1e26, 0x1e26,
02916   0x1e28, 0x1e28,
02917   0x1e2a, 0x1e2a,
02918   0x1e2c, 0x1e2c,
02919   0x1e2e, 0x1e2e,
02920   0x1e30, 0x1e30,
02921   0x1e32, 0x1e32,
02922   0x1e34, 0x1e34,
02923   0x1e36, 0x1e36,
02924   0x1e38, 0x1e38,
02925   0x1e3a, 0x1e3a,
02926   0x1e3c, 0x1e3c,
02927   0x1e3e, 0x1e3e,
02928   0x1e40, 0x1e40,
02929   0x1e42, 0x1e42,
02930   0x1e44, 0x1e44,
02931   0x1e46, 0x1e46,
02932   0x1e48, 0x1e48,
02933   0x1e4a, 0x1e4a,
02934   0x1e4c, 0x1e4c,
02935   0x1e4e, 0x1e4e,
02936   0x1e50, 0x1e50,
02937   0x1e52, 0x1e52,
02938   0x1e54, 0x1e54,
02939   0x1e56, 0x1e56,
02940   0x1e58, 0x1e58,
02941   0x1e5a, 0x1e5a,
02942   0x1e5c, 0x1e5c,
02943   0x1e5e, 0x1e5e,
02944   0x1e60, 0x1e60,
02945   0x1e62, 0x1e62,
02946   0x1e64, 0x1e64,
02947   0x1e66, 0x1e66,
02948   0x1e68, 0x1e68,
02949   0x1e6a, 0x1e6a,
02950   0x1e6c, 0x1e6c,
02951   0x1e6e, 0x1e6e,
02952   0x1e70, 0x1e70,
02953   0x1e72, 0x1e72,
02954   0x1e74, 0x1e74,
02955   0x1e76, 0x1e76,
02956   0x1e78, 0x1e78,
02957   0x1e7a, 0x1e7a,
02958   0x1e7c, 0x1e7c,
02959   0x1e7e, 0x1e7e,
02960   0x1e80, 0x1e80,
02961   0x1e82, 0x1e82,
02962   0x1e84, 0x1e84,
02963   0x1e86, 0x1e86,
02964   0x1e88, 0x1e88,
02965   0x1e8a, 0x1e8a,
02966   0x1e8c, 0x1e8c,
02967   0x1e8e, 0x1e8e,
02968   0x1e90, 0x1e90,
02969   0x1e92, 0x1e92,
02970   0x1e94, 0x1e94,
02971   0x1ea0, 0x1ea0,
02972   0x1ea2, 0x1ea2,
02973   0x1ea4, 0x1ea4,
02974   0x1ea6, 0x1ea6,
02975   0x1ea8, 0x1ea8,
02976   0x1eaa, 0x1eaa,
02977   0x1eac, 0x1eac,
02978   0x1eae, 0x1eae,
02979   0x1eb0, 0x1eb0,
02980   0x1eb2, 0x1eb2,
02981   0x1eb4, 0x1eb4,
02982   0x1eb6, 0x1eb6,
02983   0x1eb8, 0x1eb8,
02984   0x1eba, 0x1eba,
02985   0x1ebc, 0x1ebc,
02986   0x1ebe, 0x1ebe,
02987   0x1ec0, 0x1ec0,
02988   0x1ec2, 0x1ec2,
02989   0x1ec4, 0x1ec4,
02990   0x1ec6, 0x1ec6,
02991   0x1ec8, 0x1ec8,
02992   0x1eca, 0x1eca,
02993   0x1ecc, 0x1ecc,
02994   0x1ece, 0x1ece,
02995   0x1ed0, 0x1ed0,
02996   0x1ed2, 0x1ed2,
02997   0x1ed4, 0x1ed4,
02998   0x1ed6, 0x1ed6,
02999   0x1ed8, 0x1ed8,
03000   0x1eda, 0x1eda,
03001   0x1edc, 0x1edc,
03002   0x1ede, 0x1ede,
03003   0x1ee0, 0x1ee0,
03004   0x1ee2, 0x1ee2,
03005   0x1ee4, 0x1ee4,
03006   0x1ee6, 0x1ee6,
03007   0x1ee8, 0x1ee8,
03008   0x1eea, 0x1eea,
03009   0x1eec, 0x1eec,
03010   0x1eee, 0x1eee,
03011   0x1ef0, 0x1ef0,
03012   0x1ef2, 0x1ef2,
03013   0x1ef4, 0x1ef4,
03014   0x1ef6, 0x1ef6,
03015   0x1ef8, 0x1ef8,
03016   0x1f08, 0x1f0f,
03017   0x1f18, 0x1f1d,
03018   0x1f28, 0x1f2f,
03019   0x1f38, 0x1f3f,
03020   0x1f48, 0x1f4d,
03021   0x1f59, 0x1f59,
03022   0x1f5b, 0x1f5b,
03023   0x1f5d, 0x1f5d,
03024   0x1f5f, 0x1f5f,
03025   0x1f68, 0x1f6f,
03026   0x1fb8, 0x1fbb,
03027   0x1fc8, 0x1fcb,
03028   0x1fd8, 0x1fdb,
03029   0x1fe8, 0x1fec,
03030   0x1ff8, 0x1ffb,
03031   0x2102, 0x2102,
03032   0x2107, 0x2107,
03033   0x210b, 0x210d,
03034   0x2110, 0x2112,
03035   0x2115, 0x2115,
03036   0x2119, 0x211d,
03037   0x2124, 0x2124,
03038   0x2126, 0x2126,
03039   0x2128, 0x2128,
03040   0x212a, 0x212d,
03041   0x2130, 0x2131,
03042   0x2133, 0x2133,
03043   0x213e, 0x213f,
03044   0x2145, 0x2145,
03045   0xff21, 0xff3a,
03046   0x10400, 0x10427,
03047   0x1d400, 0x1d419,
03048   0x1d434, 0x1d44d,
03049   0x1d468, 0x1d481,
03050   0x1d49c, 0x1d49c,
03051   0x1d49e, 0x1d49f,
03052   0x1d4a2, 0x1d4a2,
03053   0x1d4a5, 0x1d4a6,
03054   0x1d4a9, 0x1d4ac,
03055   0x1d4ae, 0x1d4b5,
03056   0x1d4d0, 0x1d4e9,
03057   0x1d504, 0x1d505,
03058   0x1d507, 0x1d50a,
03059   0x1d50d, 0x1d514,
03060   0x1d516, 0x1d51c,
03061   0x1d538, 0x1d539,
03062   0x1d53b, 0x1d53e,
03063   0x1d540, 0x1d544,
03064   0x1d546, 0x1d546,
03065   0x1d54a, 0x1d550,
03066   0x1d56c, 0x1d585,
03067   0x1d5a0, 0x1d5b9,
03068   0x1d5d4, 0x1d5ed,
03069   0x1d608, 0x1d621,
03070   0x1d63c, 0x1d655,
03071   0x1d670, 0x1d689,
03072   0x1d6a8, 0x1d6c0,
03073   0x1d6e2, 0x1d6fa,
03074   0x1d71c, 0x1d734,
03075   0x1d756, 0x1d76e,
03076   0x1d790, 0x1d7a8
03077 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
03078 }; /* end of MBUpper */
03079 
03080 static const OnigCodePoint SBXDigit[] = {
03081   3,
03082   0x0030, 0x0039,
03083   0x0041, 0x0046,
03084   0x0061, 0x0066
03085 };
03086 
03087 static const OnigCodePoint SBASCII[] = {
03088   1,
03089   0x0000, 0x007f
03090 };
03091 
03092 static const OnigCodePoint SBWord[] = {
03093   4,
03094   0x0030, 0x0039,
03095   0x0041, 0x005a,
03096   0x005f, 0x005f,
03097   0x0061, 0x007a
03098 };
03099 
03100 static const OnigCodePoint MBWord[] = {
03101 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
03102   432,
03103 #else
03104   8,
03105 #endif
03106   0x00aa, 0x00aa,
03107   0x00b2, 0x00b3,
03108   0x00b5, 0x00b5,
03109   0x00b9, 0x00ba,
03110   0x00bc, 0x00be,
03111   0x00c0, 0x00d6,
03112   0x00d8, 0x00f6,
03113 #ifndef USE_UNICODE_FULL_RANGE_CTYPE
03114   0x00f8, 0x7fffffff
03115 #else /* not USE_UNICODE_FULL_RANGE_CTYPE */
03116   0x00f8, 0x0236,
03117   0x0250, 0x02c1,
03118   0x02c6, 0x02d1,
03119   0x02e0, 0x02e4,
03120   0x02ee, 0x02ee,
03121   0x0300, 0x0357,
03122   0x035d, 0x036f,
03123   0x037a, 0x037a,
03124   0x0386, 0x0386,
03125   0x0388, 0x038a,
03126   0x038c, 0x038c,
03127   0x038e, 0x03a1,
03128   0x03a3, 0x03ce,
03129   0x03d0, 0x03f5,
03130   0x03f7, 0x03fb,
03131   0x0400, 0x0481,
03132   0x0483, 0x0486,
03133   0x0488, 0x04ce,
03134   0x04d0, 0x04f5,
03135   0x04f8, 0x04f9,
03136   0x0500, 0x050f,
03137   0x0531, 0x0556,
03138   0x0559, 0x0559,
03139   0x0561, 0x0587,
03140   0x0591, 0x05a1,
03141   0x05a3, 0x05b9,
03142   0x05bb, 0x05bd,
03143   0x05bf, 0x05bf,
03144   0x05c1, 0x05c2,
03145   0x05c4, 0x05c4,
03146   0x05d0, 0x05ea,
03147   0x05f0, 0x05f2,
03148   0x0610, 0x0615,
03149   0x0621, 0x063a,
03150   0x0640, 0x0658,
03151   0x0660, 0x0669,
03152   0x066e, 0x06d3,
03153   0x06d5, 0x06dc,
03154   0x06de, 0x06e8,
03155   0x06ea, 0x06fc,
03156   0x06ff, 0x06ff,
03157   0x0710, 0x074a,
03158   0x074d, 0x074f,
03159   0x0780, 0x07b1,
03160   0x0901, 0x0939,
03161   0x093c, 0x094d,
03162   0x0950, 0x0954,
03163   0x0958, 0x0963,
03164   0x0966, 0x096f,
03165   0x0981, 0x0983,
03166   0x0985, 0x098c,
03167   0x098f, 0x0990,
03168   0x0993, 0x09a8,
03169   0x09aa, 0x09b0,
03170   0x09b2, 0x09b2,
03171   0x09b6, 0x09b9,
03172   0x09bc, 0x09c4,
03173   0x09c7, 0x09c8,
03174   0x09cb, 0x09cd,
03175   0x09d7, 0x09d7,
03176   0x09dc, 0x09dd,
03177   0x09df, 0x09e3,
03178   0x09e6, 0x09f1,
03179   0x09f4, 0x09f9,
03180   0x0a01, 0x0a03,
03181   0x0a05, 0x0a0a,
03182   0x0a0f, 0x0a10,
03183   0x0a13, 0x0a28,
03184   0x0a2a, 0x0a30,
03185   0x0a32, 0x0a33,
03186   0x0a35, 0x0a36,
03187   0x0a38, 0x0a39,
03188   0x0a3c, 0x0a3c,
03189   0x0a3e, 0x0a42,
03190   0x0a47, 0x0a48,
03191   0x0a4b, 0x0a4d,
03192   0x0a59, 0x0a5c,
03193   0x0a5e, 0x0a5e,
03194   0x0a66, 0x0a74,
03195   0x0a81, 0x0a83,
03196   0x0a85, 0x0a8d,
03197   0x0a8f, 0x0a91,
03198   0x0a93, 0x0aa8,
03199   0x0aaa, 0x0ab0,
03200   0x0ab2, 0x0ab3,
03201   0x0ab5, 0x0ab9,
03202   0x0abc, 0x0ac5,
03203   0x0ac7, 0x0ac9,
03204   0x0acb, 0x0acd,
03205   0x0ad0, 0x0ad0,
03206   0x0ae0, 0x0ae3,
03207   0x0ae6, 0x0aef,
03208   0x0b01, 0x0b03,
03209   0x0b05, 0x0b0c,
03210   0x0b0f, 0x0b10,
03211   0x0b13, 0x0b28,
03212   0x0b2a, 0x0b30,
03213   0x0b32, 0x0b33,
03214   0x0b35, 0x0b39,
03215   0x0b3c, 0x0b43,
03216   0x0b47, 0x0b48,
03217   0x0b4b, 0x0b4d,
03218   0x0b56, 0x0b57,
03219   0x0b5c, 0x0b5d,
03220   0x0b5f, 0x0b61,
03221   0x0b66, 0x0b6f,
03222   0x0b71, 0x0b71,
03223   0x0b82, 0x0b83,
03224   0x0b85, 0x0b8a,
03225   0x0b8e, 0x0b90,
03226   0x0b92, 0x0b95,
03227   0x0b99, 0x0b9a,
03228   0x0b9c, 0x0b9c,
03229   0x0b9e, 0x0b9f,
03230   0x0ba3, 0x0ba4,
03231   0x0ba8, 0x0baa,
03232   0x0bae, 0x0bb5,
03233   0x0bb7, 0x0bb9,
03234   0x0bbe, 0x0bc2,
03235   0x0bc6, 0x0bc8,
03236   0x0bca, 0x0bcd,
03237   0x0bd7, 0x0bd7,
03238   0x0be7, 0x0bf2,
03239   0x0c01, 0x0c03,
03240   0x0c05, 0x0c0c,
03241   0x0c0e, 0x0c10,
03242   0x0c12, 0x0c28,
03243   0x0c2a, 0x0c33,
03244   0x0c35, 0x0c39,
03245   0x0c3e, 0x0c44,
03246   0x0c46, 0x0c48,
03247   0x0c4a, 0x0c4d,
03248   0x0c55, 0x0c56,
03249   0x0c60, 0x0c61,
03250   0x0c66, 0x0c6f,
03251   0x0c82, 0x0c83,
03252   0x0c85, 0x0c8c,
03253   0x0c8e, 0x0c90,
03254   0x0c92, 0x0ca8,
03255   0x0caa, 0x0cb3,
03256   0x0cb5, 0x0cb9,
03257   0x0cbc, 0x0cc4,
03258   0x0cc6, 0x0cc8,
03259   0x0cca, 0x0ccd,
03260   0x0cd5, 0x0cd6,
03261   0x0cde, 0x0cde,
03262   0x0ce0, 0x0ce1,
03263   0x0ce6, 0x0cef,
03264   0x0d02, 0x0d03,
03265   0x0d05, 0x0d0c,
03266   0x0d0e, 0x0d10,
03267   0x0d12, 0x0d28,
03268   0x0d2a, 0x0d39,
03269   0x0d3e, 0x0d43,
03270   0x0d46, 0x0d48,
03271   0x0d4a, 0x0d4d,
03272   0x0d57, 0x0d57,
03273   0x0d60, 0x0d61,
03274   0x0d66, 0x0d6f,
03275   0x0d82, 0x0d83,
03276   0x0d85, 0x0d96,
03277   0x0d9a, 0x0db1,
03278   0x0db3, 0x0dbb,
03279   0x0dbd, 0x0dbd,
03280   0x0dc0, 0x0dc6,
03281   0x0dca, 0x0dca,
03282   0x0dcf, 0x0dd4,
03283   0x0dd6, 0x0dd6,
03284   0x0dd8, 0x0ddf,
03285   0x0df2, 0x0df3,
03286   0x0e01, 0x0e3a,
03287   0x0e40, 0x0e4e,
03288   0x0e50, 0x0e59,
03289   0x0e81, 0x0e82,
03290   0x0e84, 0x0e84,
03291   0x0e87, 0x0e88,
03292   0x0e8a, 0x0e8a,
03293   0x0e8d, 0x0e8d,
03294   0x0e94, 0x0e97,
03295   0x0e99, 0x0e9f,
03296   0x0ea1, 0x0ea3,
03297   0x0ea5, 0x0ea5,
03298   0x0ea7, 0x0ea7,
03299   0x0eaa, 0x0eab,
03300   0x0ead, 0x0eb9,
03301   0x0ebb, 0x0ebd,
03302   0x0ec0, 0x0ec4,
03303   0x0ec6, 0x0ec6,
03304   0x0ec8, 0x0ecd,
03305   0x0ed0, 0x0ed9,
03306   0x0edc, 0x0edd,
03307   0x0f00, 0x0f00,
03308   0x0f18, 0x0f19,
03309   0x0f20, 0x0f33,
03310   0x0f35, 0x0f35,
03311   0x0f37, 0x0f37,
03312   0x0f39, 0x0f39,
03313   0x0f3e, 0x0f47,
03314   0x0f49, 0x0f6a,
03315   0x0f71, 0x0f84,
03316   0x0f86, 0x0f8b,
03317   0x0f90, 0x0f97,
03318   0x0f99, 0x0fbc,
03319   0x0fc6, 0x0fc6,
03320   0x1000, 0x1021,
03321   0x1023, 0x1027,
03322   0x1029, 0x102a,
03323   0x102c, 0x1032,
03324   0x1036, 0x1039,
03325   0x1040, 0x1049,
03326   0x1050, 0x1059,
03327   0x10a0, 0x10c5,
03328   0x10d0, 0x10f8,
03329   0x1100, 0x1159,
03330   0x115f, 0x11a2,
03331   0x11a8, 0x11f9,
03332   0x1200, 0x1206,
03333   0x1208, 0x1246,
03334   0x1248, 0x1248,
03335   0x124a, 0x124d,
03336   0x1250, 0x1256,
03337   0x1258, 0x1258,
03338   0x125a, 0x125d,
03339   0x1260, 0x1286,
03340   0x1288, 0x1288,
03341   0x128a, 0x128d,
03342   0x1290, 0x12ae,
03343   0x12b0, 0x12b0,
03344   0x12b2, 0x12b5,
03345   0x12b8, 0x12be,
03346   0x12c0, 0x12c0,
03347   0x12c2, 0x12c5,
03348   0x12c8, 0x12ce,
03349   0x12d0, 0x12d6,
03350   0x12d8, 0x12ee,
03351   0x12f0, 0x130e,
03352   0x1310, 0x1310,
03353   0x1312, 0x1315,
03354   0x1318, 0x131e,
03355   0x1320, 0x1346,
03356   0x1348, 0x135a,
03357   0x1369, 0x137c,
03358   0x13a0, 0x13f4,
03359   0x1401, 0x166c,
03360   0x166f, 0x1676,
03361   0x1681, 0x169a,
03362   0x16a0, 0x16ea,
03363   0x16ee, 0x16f0,
03364   0x1700, 0x170c,
03365   0x170e, 0x1714,
03366   0x1720, 0x1734,
03367   0x1740, 0x1753,
03368   0x1760, 0x176c,
03369   0x176e, 0x1770,
03370   0x1772, 0x1773,
03371   0x1780, 0x17b3,
03372   0x17b6, 0x17d3,
03373   0x17d7, 0x17d7,
03374   0x17dc, 0x17dd,
03375   0x17e0, 0x17e9,
03376   0x17f0, 0x17f9,
03377   0x180b, 0x180d,
03378   0x1810, 0x1819,
03379   0x1820, 0x1877,
03380   0x1880, 0x18a9,
03381   0x1900, 0x191c,
03382   0x1920, 0x192b,
03383   0x1930, 0x193b,
03384   0x1946, 0x196d,
03385   0x1970, 0x1974,
03386   0x1d00, 0x1d6b,
03387   0x1e00, 0x1e9b,
03388   0x1ea0, 0x1ef9,
03389   0x1f00, 0x1f15,
03390   0x1f18, 0x1f1d,
03391   0x1f20, 0x1f45,
03392   0x1f48, 0x1f4d,
03393   0x1f50, 0x1f57,
03394   0x1f59, 0x1f59,
03395   0x1f5b, 0x1f5b,
03396   0x1f5d, 0x1f5d,
03397   0x1f5f, 0x1f7d,
03398   0x1f80, 0x1fb4,
03399   0x1fb6, 0x1fbc,
03400   0x1fbe, 0x1fbe,
03401   0x1fc2, 0x1fc4,
03402   0x1fc6, 0x1fcc,
03403   0x1fd0, 0x1fd3,
03404   0x1fd6, 0x1fdb,
03405   0x1fe0, 0x1fec,
03406   0x1ff2, 0x1ff4,
03407   0x1ff6, 0x1ffc,
03408   0x203f, 0x2040,
03409   0x2054, 0x2054,
03410   0x2070, 0x2071,
03411   0x2074, 0x2079,
03412   0x207f, 0x2089,
03413   0x20d0, 0x20ea,
03414   0x2102, 0x2102,
03415   0x2107, 0x2107,
03416   0x210a, 0x2113,
03417   0x2115, 0x2115,
03418   0x2119, 0x211d,
03419   0x2124, 0x2124,
03420   0x2126, 0x2126,
03421   0x2128, 0x2128,
03422   0x212a, 0x212d,
03423   0x212f, 0x2131,
03424   0x2133, 0x2139,
03425   0x213d, 0x213f,
03426   0x2145, 0x2149,
03427   0x2153, 0x2183,
03428   0x2460, 0x249b,
03429   0x24ea, 0x24ff,
03430   0x2776, 0x2793,
03431   0x3005, 0x3007,
03432   0x3021, 0x302f,
03433   0x3031, 0x3035,
03434   0x3038, 0x303c,
03435   0x3041, 0x3096,
03436   0x3099, 0x309a,
03437   0x309d, 0x309f,
03438   0x30a1, 0x30ff,
03439   0x3105, 0x312c,
03440   0x3131, 0x318e,
03441   0x3192, 0x3195,
03442   0x31a0, 0x31b7,
03443   0x31f0, 0x31ff,
03444   0x3220, 0x3229,
03445   0x3251, 0x325f,
03446   0x3280, 0x3289,
03447   0x32b1, 0x32bf,
03448   0x3400, 0x4db5,
03449   0x4e00, 0x9fa5,
03450   0xa000, 0xa48c,
03451   0xac00, 0xd7a3,
03452   0xf900, 0xfa2d,
03453   0xfa30, 0xfa6a,
03454   0xfb00, 0xfb06,
03455   0xfb13, 0xfb17,
03456   0xfb1d, 0xfb28,
03457   0xfb2a, 0xfb36,
03458   0xfb38, 0xfb3c,
03459   0xfb3e, 0xfb3e,
03460   0xfb40, 0xfb41,
03461   0xfb43, 0xfb44,
03462   0xfb46, 0xfbb1,
03463   0xfbd3, 0xfd3d,
03464   0xfd50, 0xfd8f,
03465   0xfd92, 0xfdc7,
03466   0xfdf0, 0xfdfb,
03467   0xfe00, 0xfe0f,
03468   0xfe20, 0xfe23,
03469   0xfe33, 0xfe34,
03470   0xfe4d, 0xfe4f,
03471   0xfe70, 0xfe74,
03472   0xfe76, 0xfefc,
03473   0xff10, 0xff19,
03474   0xff21, 0xff3a,
03475   0xff3f, 0xff3f,
03476   0xff41, 0xff5a,
03477   0xff65, 0xffbe,
03478   0xffc2, 0xffc7,
03479   0xffca, 0xffcf,
03480   0xffd2, 0xffd7,
03481   0xffda, 0xffdc,
03482   0x10000, 0x1000b,
03483   0x1000d, 0x10026,
03484   0x10028, 0x1003a,
03485   0x1003c, 0x1003d,
03486   0x1003f, 0x1004d,
03487   0x10050, 0x1005d,
03488   0x10080, 0x100fa,
03489   0x10107, 0x10133,
03490   0x10300, 0x1031e,
03491   0x10320, 0x10323,
03492   0x10330, 0x1034a,
03493   0x10380, 0x1039d,
03494   0x10400, 0x1049d,
03495   0x104a0, 0x104a9,
03496   0x10800, 0x10805,
03497   0x10808, 0x10808,
03498   0x1080a, 0x10835,
03499   0x10837, 0x10838,
03500   0x1083c, 0x1083c,
03501   0x1083f, 0x1083f,
03502   0x1d165, 0x1d169,
03503   0x1d16d, 0x1d172,
03504   0x1d17b, 0x1d182,
03505   0x1d185, 0x1d18b,
03506   0x1d1aa, 0x1d1ad,
03507   0x1d400, 0x1d454,
03508   0x1d456, 0x1d49c,
03509   0x1d49e, 0x1d49f,
03510   0x1d4a2, 0x1d4a2,
03511   0x1d4a5, 0x1d4a6,
03512   0x1d4a9, 0x1d4ac,
03513   0x1d4ae, 0x1d4b9,
03514   0x1d4bb, 0x1d4bb,
03515   0x1d4bd, 0x1d4c3,
03516   0x1d4c5, 0x1d505,
03517   0x1d507, 0x1d50a,
03518   0x1d50d, 0x1d514,
03519   0x1d516, 0x1d51c,
03520   0x1d51e, 0x1d539,
03521   0x1d53b, 0x1d53e,
03522   0x1d540, 0x1d544,
03523   0x1d546, 0x1d546,
03524   0x1d54a, 0x1d550,
03525   0x1d552, 0x1d6a3,
03526   0x1d6a8, 0x1d6c0,
03527   0x1d6c2, 0x1d6da,
03528   0x1d6dc, 0x1d6fa,
03529   0x1d6fc, 0x1d714,
03530   0x1d716, 0x1d734,
03531   0x1d736, 0x1d74e,
03532   0x1d750, 0x1d76e,
03533   0x1d770, 0x1d788,
03534   0x1d78a, 0x1d7a8,
03535   0x1d7aa, 0x1d7c2,
03536   0x1d7c4, 0x1d7c9,
03537   0x1d7ce, 0x1d7ff,
03538   0x20000, 0x2a6d6,
03539   0x2f800, 0x2fa1d,
03540   0xe0100, 0xe01ef
03541 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
03542 }; /* end of MBWord */
03543 
03544 
03545 static int
03546 utf8_get_ctype_code_range(int ctype,
03547                           const OnigCodePoint* sbr[], const OnigCodePoint* mbr[])
03548 {
03549 #define CR_SET(sbl,mbl) do { \
03550   *sbr = sbl; \
03551   *mbr = mbl; \
03552 } while (0)
03553 
03554 #define CR_SB_SET(sbl) do { \
03555   *sbr = sbl; \
03556   *mbr = EmptyRange; \
03557 } while (0)
03558 
03559   switch (ctype) {
03560   case ONIGENC_CTYPE_ALPHA:
03561     CR_SET(SBAlpha, MBAlpha);
03562     break;
03563   case ONIGENC_CTYPE_BLANK:
03564     CR_SET(SBBlank, MBBlank);
03565     break;
03566   case ONIGENC_CTYPE_CNTRL:
03567     CR_SET(SBCntrl, MBCntrl);
03568     break;
03569   case ONIGENC_CTYPE_DIGIT:
03570     CR_SET(SBDigit, MBDigit);
03571     break;
03572   case ONIGENC_CTYPE_GRAPH:
03573     CR_SET(SBGraph, MBGraph);
03574     break;
03575   case ONIGENC_CTYPE_LOWER:
03576     CR_SET(SBLower, MBLower);
03577     break;
03578   case ONIGENC_CTYPE_PRINT:
03579     CR_SET(SBPrint, MBPrint);
03580     break;
03581   case ONIGENC_CTYPE_PUNCT:
03582     CR_SET(SBPunct, MBPunct);
03583     break;
03584   case ONIGENC_CTYPE_SPACE:
03585     CR_SET(SBSpace, MBSpace);
03586     break;
03587   case ONIGENC_CTYPE_UPPER:
03588     CR_SET(SBUpper, MBUpper);
03589     break;
03590   case ONIGENC_CTYPE_XDIGIT:
03591     CR_SB_SET(SBXDigit);
03592     break;
03593   case ONIGENC_CTYPE_WORD:
03594     CR_SET(SBWord, MBWord);
03595     break;
03596   case ONIGENC_CTYPE_ASCII:
03597     CR_SB_SET(SBASCII);
03598     break;
03599   case ONIGENC_CTYPE_ALNUM:
03600     CR_SET(SBAlnum, MBAlnum);
03601     break;
03602 
03603   default:
03604     return ONIGENCERR_TYPE_BUG;
03605     break;
03606   }
03607 
03608   return 0;
03609 }
03610 
03611 static int
03612 utf8_is_code_ctype(OnigCodePoint code, unsigned int ctype)
03613 {
03614 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
03615   const OnigCodePoint *range;
03616 #endif
03617 
03618   if (code < 256) {
03619     return ONIGENC_IS_UNICODE_ISO_8859_1_CTYPE(code, ctype);
03620   }
03621 
03622 #ifdef USE_UNICODE_FULL_RANGE_CTYPE
03623 
03624   switch (ctype) {
03625   case ONIGENC_CTYPE_ALPHA:
03626     range = MBAlpha;
03627     break;
03628   case ONIGENC_CTYPE_BLANK:
03629     range = MBBlank;
03630     break;
03631   case ONIGENC_CTYPE_CNTRL:
03632     range = MBCntrl;
03633     break;
03634   case ONIGENC_CTYPE_DIGIT:
03635     range = MBDigit;
03636     break;
03637   case ONIGENC_CTYPE_GRAPH:
03638     range = MBGraph;
03639     break;
03640   case ONIGENC_CTYPE_LOWER:
03641     range = MBLower;
03642     break;
03643   case ONIGENC_CTYPE_PRINT:
03644     range = MBPrint;
03645     break;
03646   case ONIGENC_CTYPE_PUNCT:
03647     range = MBPunct;
03648     break;
03649   case ONIGENC_CTYPE_SPACE:
03650     range = MBSpace;
03651     break;
03652   case ONIGENC_CTYPE_UPPER:
03653     range = MBUpper;
03654     break;
03655   case ONIGENC_CTYPE_XDIGIT:
03656     return FALSE;
03657     break;
03658   case ONIGENC_CTYPE_WORD:
03659     range = MBWord;
03660     break;
03661   case ONIGENC_CTYPE_ASCII:
03662     return FALSE;
03663     break;
03664   case ONIGENC_CTYPE_ALNUM:
03665     range = MBAlnum;
03666     break;
03667   case ONIGENC_CTYPE_NEWLINE:
03668     return FALSE;
03669     break;
03670 
03671   default:
03672     return ONIGENCERR_TYPE_BUG;
03673     break;
03674   }
03675 
03676   return onig_is_in_code_range((UChar* )range, code);
03677 
03678 #else
03679 
03680   if ((ctype & ONIGENC_CTYPE_WORD) != 0) {
03681 #ifdef USE_INVALID_CODE_SCHEME
03682     if (code <= VALID_CODE_LIMIT)
03683 #endif
03684       return TRUE;
03685   }
03686 #endif /* USE_UNICODE_FULL_RANGE_CTYPE */
03687 
03688   return FALSE;
03689 }
03690 
03691 static UChar*
03692 utf8_left_adjust_char_head(const UChar* start, const UChar* s)
03693 {
03694   const UChar *p;
03695 
03696   if (s <= start) return (UChar* )s;
03697   p = s;
03698 
03699   while (!utf8_islead(*p) && p > start) p--;
03700   return (UChar* )p;
03701 }
03702 
03703 OnigEncodingType OnigEncodingUTF8 = {
03704   utf8_mbc_enc_len,
03705   "UTF-8",     /* name */
03706   6,           /* max byte length */
03707   1,           /* min byte length */
03708   (ONIGENC_AMBIGUOUS_MATCH_ASCII_CASE | 
03709    ONIGENC_AMBIGUOUS_MATCH_NONASCII_CASE ),
03710   {
03711       (OnigCodePoint )'\\'                       /* esc */
03712     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar '.'  */
03713     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anytime '*'  */
03714     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* zero or one time '?' */
03715     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* one or more time '+' */
03716     , (OnigCodePoint )ONIG_INEFFECTIVE_META_CHAR /* anychar anytime */
03717   },
03718   utf8_is_mbc_newline,
03719   utf8_mbc_to_code,
03720   utf8_code_to_mbclen,
03721   utf8_code_to_mbc,
03722   utf8_mbc_to_normalize,
03723   utf8_is_mbc_ambiguous,
03724   onigenc_iso_8859_1_get_all_pair_ambig_codes,
03725   onigenc_ess_tsett_get_all_comp_ambig_codes,
03726   utf8_is_code_ctype,
03727   utf8_get_ctype_code_range,
03728   utf8_left_adjust_char_head,
03729   onigenc_always_true_is_allowed_reverse_match
03730 };