mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
31b6ea65bb
commit
7d3598ee60
2 changed files with 11 additions and 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.
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue