diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | transcode.c | 9 |
2 files changed, 11 insertions, 3 deletions
@@ -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; |