summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-05 19:03:21 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-05 19:03:21 +0000
commit7d3598ee60264be084f8a6d15d50544e96de5afe (patch)
tree6af92e43c5f0269497618ca2b7e0b00517a89b9c
parent31b6ea65bb9aa9b5ef16ff0a9ca021f66a207300 (diff)
* transcode.c (rb_econv_convert): use ECONV_INVALID_MASK and
ECONV_UNDEF_MASK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--transcode.c9
2 files changed, 11 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0625fdcee4..c9955d243e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Sep 6 03:52:47 2008 Tanaka Akira <akr@fsij.org>
+
+ * transcode.c (rb_econv_convert): use ECONV_INVALID_MASK and
+ ECONV_UNDEF_MASK.
+
Sat Sep 6 06:05:09 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* include/ruby/ruby.h (DBL2NUM): renamed from DOUBLE2NUM.
diff --git a/transcode.c b/transcode.c
index 09c732366d..766425125d 100644
--- a/transcode.c
+++ b/transcode.c
@@ -1289,7 +1289,8 @@ rb_econv_convert(rb_econv_t *ec,
ret == econv_incomplete_input) {
/* deal with invalid byte sequence */
/* todo: add more alternative behaviors */
- if (ec->flags&ECONV_INVALID_REPLACE) {
+ switch (ec->flags & ECONV_INVALID_MASK) {
+ case ECONV_INVALID_REPLACE:
if (output_replacement_character(ec) == 0)
goto resume;
}
@@ -1299,10 +1300,12 @@ rb_econv_convert(rb_econv_t *ec,
/* valid character in source encoding
* but no related character(s) in destination encoding */
/* todo: add more alternative behaviors */
- if (ec->flags&ECONV_UNDEF_REPLACE) {
+ switch (ec->flags & ECONV_UNDEF_MASK) {
+ case ECONV_UNDEF_REPLACE:
if (output_replacement_character(ec) == 0)
goto resume;
- }
+ break;
+ }
}
return ret;