зеркало из https://github.com/github/ruby.git
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:
Родитель
fc95326e1f
Коммит
2ae5e54e62
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче