# Description: a script that generates a single byte code set to Unicode
# mapping table.
#
+
+function conv(str) {
+ if (!match(str, "^0[xX]")) {
+ return 0 + str
+ }
+
+ retval = 0
+
+ for (i = 3; i <= length(str); i++) {
+ n = index("0123456789abcdefABCDEF", substr(str, i, 1)) - 1
+
+ if (n < 0) {
+ return 0 + str;
+ } else if (n >= 16) {
+ n -= 6;
+ }
+
+ retval = retval * 16 + n
+ }
+
+ return retval
+}
+
BEGIN {
FS="[ \t#]"
}
}
{
- tbl[$1 + 0] = $2
+ tbl[conv($1)] = conv($2)
}
END {
print "#ifndef " IFNDEF_NAME
}
- print "static const unsigned int " TABLE_NAME "[] = {"
+ print "static const int " TABLE_NAME "[] = {"
i = 160;
for (;;) {
printf("\t0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x, 0x%04x", tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++], tbl[i++]);
if (i != 256) {
printf(",\n");
} else {
- print
+ print ""
break;
}
}
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_10_H
-static const unsigned int iso8859_10_ucs_table[] = {
+static const int iso8859_10_ucs_table[] = {
0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7,
0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a,
0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_13_H
-static const unsigned int iso8859_13_ucs_table[] = {
+static const int iso8859_13_ucs_table[] = {
0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7,
0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6,
0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_14_H
-static const unsigned int iso8859_14_ucs_table[] = {
+static const int iso8859_14_ucs_table[] = {
0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7,
0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178,
0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_15_H
-static const unsigned int iso8859_15_ucs_table[] = {
+static const int iso8859_15_ucs_table[] = {
0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7,
0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLEISO8859_16_H
-static const unsigned int iso8859_16_ucs_table[] = {
+static const int iso8859_16_ucs_table[] = {
0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7,
0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b,
0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_2_H
-static const unsigned int iso8859_2_ucs_table[] = {
+static const int iso8859_2_ucs_table[] = {
0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7,
0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b,
0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_3_H
-static const unsigned int iso8859_3_ucs_table[] = {
+static const int iso8859_3_ucs_table[] = {
0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7,
0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b,
0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_4_H
-static const unsigned int iso8859_4_ucs_table[] = {
+static const int iso8859_4_ucs_table[] = {
0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7,
0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af,
0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_5_H
-static const unsigned int iso8859_5_ucs_table[] = {
+static const int iso8859_5_ucs_table[] = {
0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f,
0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_6_H
-static const unsigned int iso8859_6_ucs_table[] = {
+static const int iso8859_6_ucs_table[] = {
0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_7_H
-static const unsigned int iso8859_7_ucs_table[] = {
+static const int iso8859_7_ucs_table[] = {
0x00a0, 0x2018, 0x2019, 0x00a3, 0x20ac, 0x20af, 0x00a6, 0x00a7,
0x00a8, 0x00a9, 0x037a, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015,
0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_8_H
-static const unsigned int iso8859_8_ucs_table[] = {
+static const int iso8859_8_ucs_table[] = {
0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
/* This file is automatically generated. Do not edit! */
#ifndef UNICODE_TABLE_ISO8859_9_H
-static const unsigned int iso8859_9_ucs_table[] = {
+static const int iso8859_9_ucs_table[] = {
0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
};
-php_mb_nls_ident_list php_mb_default_identify_list[] = {
+static const php_mb_nls_ident_list php_mb_default_identify_list[] = {
{ mbfl_no_language_japanese, php_mb_default_identify_list_ja, sizeof(php_mb_default_identify_list_ja) / sizeof(php_mb_default_identify_list_ja[0]) },
{ mbfl_no_language_korean, php_mb_default_identify_list_kr, sizeof(php_mb_default_identify_list_kr) / sizeof(php_mb_default_identify_list_kr[0]) },
{ mbfl_no_language_traditional_chinese, php_mb_default_identify_list_tw_hk, sizeof(php_mb_default_identify_list_tw_hk) / sizeof(php_mb_default_identify_list_tw_hk[0]) },