diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-25 15:13:14 +0000 |
commit | d0233291bc8a5068e52c69c210e5979e5324b5bc (patch) | |
tree | 7d9459449c33792c63eeb7baa071e76352e0baab /trunk/ext/iconv/mkwrapper.rb | |
parent | 0dc342de848a642ecce8db697b8fecd83a63e117 (diff) | |
parent | 72eaacaa15256ab95c3b52ea386f88586fb9da40 (diff) |
re-adding tag v1_9_0_4 as an alias of trunk@18848v1_9_0_4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v1_9_0_4@18849 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'trunk/ext/iconv/mkwrapper.rb')
-rw-r--r-- | trunk/ext/iconv/mkwrapper.rb | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/trunk/ext/iconv/mkwrapper.rb b/trunk/ext/iconv/mkwrapper.rb deleted file mode 100644 index 34718507d6..0000000000 --- a/trunk/ext/iconv/mkwrapper.rb +++ /dev/null @@ -1,53 +0,0 @@ -#! /usr/bin/ruby -require 'rbconfig' -require 'optparse' - -# http://www.ctan.org/tex-archive/macros/texinfo/texinfo/intl/config.charset -# Fri, 30 May 2003 00:09:00 GMT' - -HEADER = <<SRC -require 'iconv.so' - -class Iconv - case RUBY_PLATFORM -SRC - -def charset_alias(config_charset, mapfile = nil) - found = nil - src = [HEADER] - open(config_charset) do |input| - input.find {|line| /^case "\$os" in/ =~ line} or return - input.each do |line| - case line - when /^\s*([-\w\*]+(?:\s*\|\s*[-\w\*]+)*)(?=\))/ - (s = " when ") << $&.split('|').collect {|targ| - targ.strip! - tail = targ.chomp!("*") ? '' : '\z' - head = targ.slice!(/\A\*/) ? '' : '\A' - targ.gsub!(/\*/, '.*') - "/#{head}#{targ}#{tail}/" - }.join(", ") - src << s - found = {} - when /^\s*echo "(?:\$\w+\.)?([-\w*]+)\s+([-\w]+)"/ - sys, can = $1, $2 - can.downcase! - unless found[can] or (/\Aen_(?!US\z)/ =~ sys && /\ACP437\z/i =~ can) - found[can] = true - src << " charset_map['#{can}'] = '#{sys}'.freeze" - end - when /^\s*;;/ - found = nil - end - end - end - src << " end" << "end" - if mapfile - open(mapfile, "wb") {|f| f.puts *src} - else - puts *src - end -end - -(1..2) === ARGV.size or abort "usage: #{$0} config_charset [mapfile]" -charset_alias(*ARGV) |