From f85b841a012bb07e4b5b22a792974d7d929a091d Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 29 Oct 2010 01:03:21 +0000 Subject: * tool/enc-unicode.rb, enc/unicode/name2ctype.h, enc/unicode/name2ctype.h.blt, enc/unicode/name2ctype.kwd, enc/unicode/name2ctype.src: Add 'Unknown' Script. patched by Run Paint Run Run. [ruby-core:32937] #3998 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29626 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/enc-unicode.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tool/enc-unicode.rb') diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index 49729ec618..af70a710fd 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -129,13 +129,13 @@ def parse_scripts(data) ] current = nil cps = [] - names = [] + names = {} files.each do |file| IO.foreach(get_file(file[:fn])) do |line| if /^# Total code points: / =~ line data[current] = cps make_const(current, cps, file[:title]) - names << current + (names[file[:title]] ||= []) << current cps = [] elsif /^(\h+)(?:..(\h+))?\s*;\s*(\w+)/ =~ line current = $3 @@ -143,7 +143,11 @@ def parse_scripts(data) end end end - names + # All code points not explicitly listed for Script + # have the value Unknown (Zzzz). + data['Unknown'] = (0..0x10ffff).to_a - data.values_at(*names['Script']).flatten + make_const('Unknown', data['Unknown'], 'Script') + names.values.flatten << 'Unknown' end def parse_aliases(data) -- cgit v1.2.3