diff options
-rw-r--r-- | enc/ascii.c | 2 | ||||
-rw-r--r-- | enc/trans/ibm720-tbl.rb | 122 | ||||
-rw-r--r-- | enc/trans/single_byte.trans | 3 | ||||
-rw-r--r-- | ext/win32ole/win32ole.c | 1 | ||||
-rw-r--r-- | spec/ruby/core/string/valid_encoding_spec.rb | 8 | ||||
-rw-r--r-- | test/ruby/test_transcode.rb | 19 |
6 files changed, 154 insertions, 1 deletions
@@ -61,6 +61,8 @@ OnigEncodingDefine(ascii, ASCII) = { ENC_ALIAS("BINARY", "ASCII-8BIT") ENC_REPLICATE("IBM437", "ASCII-8BIT") ENC_ALIAS("CP437", "IBM437") ENC_REPLICATE("IBM737", "ASCII-8BIT") ENC_ALIAS("CP737", "IBM737") ENC_REPLICATE("IBM775", "ASCII-8BIT") @@ -0,0 +1,122 @@ @@ -51,8 +51,9 @@ transcode_tblgen_singlebyte "WINDOWS-1256" transcode_tblgen_singlebyte "WINDOWS-1257" transcode_tblgen_singlebyte "IBM437" - transcode_tblgen_singlebyte "IBM775" transcode_tblgen_singlebyte "IBM737" transcode_tblgen_singlebyte "IBM852" transcode_tblgen_singlebyte "IBM855" transcode_tblgen_singlebyte "IBM857" @@ -507,6 +507,7 @@ static UINT ole_encoding2cp(rb_encoding *enc) ENC_MACHING_CP(enc, "GB2312", 20936); ENC_MACHING_CP(enc, "GBK", 936); ENC_MACHING_CP(enc, "IBM437", 437); ENC_MACHING_CP(enc, "IBM737", 737); ENC_MACHING_CP(enc, "IBM775", 775); ENC_MACHING_CP(enc, "IBM852", 852); @@ -100,6 +100,14 @@ describe "String#valid_encoding?" do str.force_encoding('UTF8-MAC').valid_encoding?.should be_true end it "returns false if self is valid in one encoding, but invalid in the one it's tagged with" do str = "\u{8765}" str.valid_encoding?.should be_true @@ -469,6 +469,25 @@ class TestTranscode < Test::Unit::TestCase check_both_ways("\u00A0", "\xFF", 'IBM437') # non-breaking space end def test_IBM775 check_both_ways("\u0106", "\x80", 'IBM775') # Ć check_both_ways("\u00C5", "\x8F", 'IBM775') # Å |