diff options
Diffstat (limited to 'Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb')
-rw-r--r-- | Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb b/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb index e0004a76630..6d9606f4bc1 100644 --- a/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb +++ b/Master/texmf-dist/source/generic/hyph-utf8/hyph-utf8.rb @@ -6,8 +6,7 @@ class UnicodeCharacter def initialize(code_uni, code_enc, name) @code_uni = code_uni @code_enc = code_enc - # TODO: might be longer or shorter - @bytes = [code_uni].pack('U').unpack('H2H2') + @bytes = [code_uni].pack('U').unpack('C*') @name = name end @@ -67,7 +66,7 @@ class Encoding elsif c == 8217 # ’ new_string[i] = "'" else - puts "There must be an error: character #{c} in string #{str} is not ASCII." + puts sprintf("There must be an error: character U+%04X in string '%s' is not ASCII or %s.", c, str, @encoding_name.upcase) end # an unicode character else @@ -84,7 +83,7 @@ private filename = "#{encoding_data_dir}/#{@encoding_name}.dat" if File.exists?(filename) then - File.open(filename).grep(/^0x(\w+)\tU\+(\w+)\t(\d*)\t([_a-zA-Z\.]*)$/) do |line| + File.open(filename).grep(/^0x(\w+)\tU\+(\w+)\t(\d*)\t([_a-zA-Z0-9\.]*)$/) do |line| # puts line code_enc = $1.hex code_uni = $2.hex @@ -99,6 +98,7 @@ private @unicode_characters.add_new_character(code_uni, code_enc, name) @lowercase_characters.push(UnicodeCharacter.new(code_uni, code_enc, name)) end + @lowercase_characters.sort!{|x,y| x.code_enc <=> y.code_enc} end else # TODO: throw an error |