diff options
| author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-05 19:03:21 +0000 |
|---|---|---|
| committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-05 19:03:21 +0000 |
| commit | 615b20dee898e404ef551d1965fd216e98d73177 (patch) | |
| tree | 6af92e43c5f0269497618ca2b7e0b00517a89b9c | |
| parent | 65080e34c164169ed374c236d52e26d86a2f4f03 (diff) | |
| download | ruby-615b20dee898e404ef551d1965fd216e98d73177.tar.gz ruby-615b20dee898e404ef551d1965fd216e98d73177.tar.xz ruby-615b20dee898e404ef551d1965fd216e98d73177.zip | |
* transcode.c (rb_econv_convert): use ECONV_INVALID_MASK and
ECONV_UNDEF_MASK.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -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 09c732366..766425125 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; |
