diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-13 20:46:00 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-13 20:46:00 +0000 |
commit | 5b46f99ce1111eec5fc45ea0b9d9631b09aa02d9 () | |
tree | 7703aa64fb18ec9f329857ee7c023031711298b2 /enc | |
parent | 50bbc4e6ae9229907ad08730ab7330024361918a (diff) |
* enc/*.c: add replicas and aliases.
* enc/make_encdb.h: add duplicate and undefined check. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | enc/ascii.c | 44 | ||||
-rw-r--r-- | enc/big5.c | 1 | ||||
-rw-r--r-- | enc/iso_8859_11.c | 3 | ||||
-rwxr-xr-x | enc/make_encdb.rb | 36 | ||||
-rw-r--r-- | enc/shift_jis.c | 2 | ||||
-rw-r--r-- | enc/windows_1251.c | 2 |
6 files changed, 78 insertions, 10 deletions
@@ -48,3 +48,47 @@ OnigEncodingDefine(ascii, ASCII) = { onigenc_always_true_is_allowed_reverse_match }; ENC_ALIAS("BINARY", "ASCII-8BIT"); @@ -162,3 +162,4 @@ OnigEncodingDefine(big5, BIG5) = { big5_left_adjust_char_head, big5_is_allowed_reverse_match }; @@ -95,5 +95,6 @@ OnigEncodingDefine(iso_8859_11, ISO_8859_11) = { onigenc_always_true_is_allowed_reverse_match }; ENC_ALIAS("ISO8859-11", "ISO-8859-11"); ENC_REPLICATE("Windows-874", "ISO-8859-11"); -ENC_ALIAS("CP874", "ISO-8859-11"); @@ -9,6 +9,12 @@ # ENC_ALIAS("CP932", "Windows-31J") # encodings = [] replicas = {} aliases = {} @@ -17,20 +23,34 @@ Dir.open(encdir) {|d| d.grep(/.+\.c\z/)}.sort.each do |fn| open(File.join(encdir,fn)) do |f| orig = nil name = nil f.each_line do |line| break if /^OnigEncodingDefine/o =~ line end f.each_line do |line| break if /"(.*?)"/ =~ line end - encodings << $1 if $1 - f.each_line do |line| - if /^ENC_REPLICATE\(\s*"([^"]+)"\s*,\s*"([^"]+)"/o =~ line - encodings << $1 - replicas[$1] = $2 - elsif /^ENC_ALIAS\(\s*"([^"]+)"\s*,\s*"([^"]+)"/o =~ line - encodings << $1 - aliases[$1] = $2 end end end @@ -376,3 +376,5 @@ ENC_ALIAS("SJIS", "Shift_JIS"); ENC_REPLICATE("Windows-31J", "Shift_JIS"); ENC_ALIAS("CP932", "Windows-31J"); ENC_ALIAS("csWindows31J", "Windows-31J"); /* IANA. IE6 don't accept Windows-31J but csWindows31J. */ @@ -180,7 +180,7 @@ cp1251_get_case_fold_codes_by_str(OnigCaseFoldType flag, flag, p, end, items); } -OnigEncodingType OnigEncodingCP1251 = { onigenc_single_byte_mbc_enc_len, "Windows-1251", /* name */ 1, /* max enc length */ |