summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--enc/trans/single_byte.trans2
-rw-r--r--test/ruby/test_econv.rb15
3 files changed, 20 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eb8acd588d..59f087435c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Aug 31 16:34:41 2008 Tanaka Akira <akr@fsij.org>
+
+ * enc/trans/single_byte.trans (us_ascii_map): don't define 8bit bytes.
+
Sun Aug 31 14:27:27 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (econv_last_error): new method.
diff --git a/enc/trans/single_byte.trans b/enc/trans/single_byte.trans
index 8cbf474eb5..8c9565c605 100644
--- a/enc/trans/single_byte.trans
+++ b/enc/trans/single_byte.trans
@@ -1,7 +1,7 @@
#include "transcode_data.h"
<%
- us_ascii_map = [["{00-7f}", :nomap], ["{80-ff}", :undef]]
+ us_ascii_map = [["{00-7f}", :nomap]]
ISO_8859_1_TO_UCS_TBL = (0x80..0xff).map {|c| ["%02X" % c, c] }
CONTROL1_TO_UCS_TBL = (0x80..0x9f).map {|c| ["%02X" % c, c] }
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 917b46c629..a704b05ed0 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -613,4 +613,19 @@ class TestEncodingConverter < Test::Unit::TestCase
assert_kind_of(Encoding::InvalidByteSequence, ec.last_error)
end
+ def test_us_ascii
+ ec = Encoding::Converter.new("UTF-8", "US-ASCII")
+ ec.primitive_convert(src="\u{3042}", dst="")
+ err = ec.last_error
+ assert_kind_of(Encoding::ConversionUndefined, err)
+ assert_equal("\u{3042}", err.error_char)
+ end
+
+ def test_88591
+ ec = Encoding::Converter.new("UTF-8", "ISO-8859-1")
+ ec.primitive_convert(src="\u{3042}", dst="")
+ err = ec.last_error
+ assert_kind_of(Encoding::ConversionUndefined, err)
+ assert_equal("\u{3042}", err.error_char)
+ end
end