File tree Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Expand file tree Collapse file tree 3 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -3130,6 +3130,7 @@ typedef enum {
3130
3130
} UnicodeScriptEnum ;
3131
3131
3132
3132
static const char unicode_script_name_table [] =
3133
+ "Unknown,Zzzz" "\0"
3133
3134
"Adlam,Adlm" "\0"
3134
3135
"Ahom,Ahom" "\0"
3135
3136
"Anatolian_Hieroglyphs,Hluw" "\0"
Original file line number Diff line number Diff line change @@ -1285,8 +1285,6 @@ int unicode_script(CharRange *cr,
1285
1285
script_idx = unicode_find_name (unicode_script_name_table , script_name );
1286
1286
if (script_idx < 0 )
1287
1287
return -2 ;
1288
- /* Note: we remove the "Unknown" Script */
1289
- script_idx += UNICODE_SCRIPT_Unknown + 1 ;
1290
1288
1291
1289
is_common = (script_idx == UNICODE_SCRIPT_Common ||
1292
1290
script_idx == UNICODE_SCRIPT_Inherited );
@@ -1316,17 +1314,21 @@ int unicode_script(CharRange *cr,
1316
1314
n |= * p ++ ;
1317
1315
n += 96 + (1 << 12 );
1318
1316
}
1319
- if (type == 0 )
1320
- v = 0 ;
1321
- else
1322
- v = * p ++ ;
1323
1317
c1 = c + n + 1 ;
1324
- if (v == script_idx ) {
1325
- if (cr_add_interval (cr1 , c , c1 ))
1326
- goto fail ;
1318
+ if (type != 0 ) {
1319
+ v = * p ++ ;
1320
+ if (v == script_idx || script_idx == UNICODE_SCRIPT_Unknown ) {
1321
+ if (cr_add_interval (cr1 , c , c1 ))
1322
+ goto fail ;
1323
+ }
1327
1324
}
1328
1325
c = c1 ;
1329
1326
}
1327
+ if (script_idx == UNICODE_SCRIPT_Unknown ) {
1328
+ /* Unknown is all the characters outside scripts */
1329
+ if (cr_invert (cr1 ))
1330
+ goto fail ;
1331
+ }
1330
1332
1331
1333
if (is_ext ) {
1332
1334
/* add the script extensions */
Original file line number Diff line number Diff line change @@ -2087,10 +2087,9 @@ void build_script_table(FILE *f)
2087
2087
fprintf (f , " UNICODE_SCRIPT_COUNT,\n" );
2088
2088
fprintf (f , "} UnicodeScriptEnum;\n\n" );
2089
2089
2090
- i = 1 ;
2091
2090
dump_name_table (f , "unicode_script_name_table" ,
2092
- unicode_script_name + i , SCRIPT_COUNT - i ,
2093
- unicode_script_short_name + i );
2091
+ unicode_script_name , SCRIPT_COUNT ,
2092
+ unicode_script_short_name );
2094
2093
2095
2094
dbuf_init (dbuf );
2096
2095
#ifdef DUMP_TABLE_SIZE
You can’t perform that action at this time.
0 commit comments