1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

open Unicode data in binary mode

* tool/enc-unicode.rb (data_foreach): open in binary mode because
  Unicode 9.0.0 contains non-ascii characters.

* template/unicode_norm_gen.tmpl: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-08-16 13:01:30 +00:00
parent fc95326e1f
commit 2ae5e54e62
2 changed files with 2 additions and 2 deletions

View file

@ -66,7 +66,7 @@ class Array
end
# read the file 'CompositionExclusions.txt'
composition_exclusions = vpath.open("#{InputDataDir}/CompositionExclusions.txt") {|f|
composition_exclusions = vpath.open("#{InputDataDir}/CompositionExclusions.txt", 'rb') {|f|
base = Regexp.quote(File.basename(f.path, '.*'))
ext = Regexp.quote(File.extname(f.path))
version = (line = f.gets)[/^# *#{base}-([\d.]+)#{ext}\s*$/, 1] or

View file

@ -281,7 +281,7 @@ def data_foreach(name, &block)
fn = get_file(name)
warn "Reading #{name}"
pat = /^# #{name.sub(/\./, '-([\\d.]+)\\.')}/
File.open(fn) do |f|
File.open(fn, 'rb') do |f|
line = f.gets
unless pat =~ line
raise ArgumentError, "#{name}: no Unicode version"