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 | 7d3598ee60264be084f8a6d15d50544e96de5afe (patch) | |
tree | 6af92e43c5f0269497618ca2b7e0b00517a89b9c /transcode.c | |
parent | 31b6ea65bb9aa9b5ef16ff0a9ca021f66a207300 (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
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 9 |
1 files changed, 6 insertions, 3 deletions
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; |