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 {
31303130} UnicodeScriptEnum ;
31313131
31323132static const char unicode_script_name_table [] =
3133+ "Unknown,Zzzz" "\0"
31333134 "Adlam,Adlm" "\0"
31343135 "Ahom,Ahom" "\0"
31353136 "Anatolian_Hieroglyphs,Hluw" "\0"
Original file line number Diff line number Diff line change @@ -1285,8 +1285,6 @@ int unicode_script(CharRange *cr,
12851285 script_idx = unicode_find_name (unicode_script_name_table , script_name );
12861286 if (script_idx < 0 )
12871287 return -2 ;
1288- /* Note: we remove the "Unknown" Script */
1289- script_idx += UNICODE_SCRIPT_Unknown + 1 ;
12901288
12911289 is_common = (script_idx == UNICODE_SCRIPT_Common ||
12921290 script_idx == UNICODE_SCRIPT_Inherited );
@@ -1316,17 +1314,21 @@ int unicode_script(CharRange *cr,
13161314 n |= * p ++ ;
13171315 n += 96 + (1 << 12 );
13181316 }
1319- if (type == 0 )
1320- v = 0 ;
1321- else
1322- v = * p ++ ;
13231317 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+ }
13271324 }
13281325 c = c1 ;
13291326 }
1327+ if (script_idx == UNICODE_SCRIPT_Unknown ) {
1328+ /* Unknown is all the characters outside scripts */
1329+ if (cr_invert (cr1 ))
1330+ goto fail ;
1331+ }
13301332
13311333 if (is_ext ) {
13321334 /* add the script extensions */
Original file line number Diff line number Diff line change @@ -2087,10 +2087,9 @@ void build_script_table(FILE *f)
20872087 fprintf (f , " UNICODE_SCRIPT_COUNT,\n" );
20882088 fprintf (f , "} UnicodeScriptEnum;\n\n" );
20892089
2090- i = 1 ;
20912090 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 );
20942093
20952094 dbuf_init (dbuf );
20962095#ifdef DUMP_TABLE_SIZE
You can’t perform that action at this time.
0 commit comments