diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-05 10:39:56 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-03-05 10:39:56 +0000 |
commit | f453c3c0dadd093518335f75a2bb8ec50a283afb (patch) | |
tree | 2b920e59d60f22bc5c10ae132a948ad6dae597a4 | |
parent | 4bcae18e375dcfc880be52f7b89ef2d45f75b57b (diff) |
* transcode.c (econv_opts): set :undef => :replace when
:replace is given and :invalid is not given. [ruby-dev:40554]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | transcode.c | 5 |
2 files changed, 10 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Fri Mar 5 19:36:12 2010 NARUSE, Yui <naruse@ruby-lang.org> + + * transcode.c (econv_opts): set :undef => :replace when + :replace is given and :invalid is not given. [ruby-dev:40554] + Fri Mar 5 17:51:09 2010 Nobuyoshi Nakada <nobu@ruby-lang.org> * io.c (pipe_open): suppressed a warning. diff --git a/transcode.c b/transcode.c index d511547916..9d6a886850 100644 --- a/transcode.c +++ b/transcode.c @@ -2394,6 +2394,11 @@ econv_opts(VALUE opt) rb_raise(rb_eArgError, "unknown value for undefined character option"); } + v = rb_hash_aref(opt, sym_replace); + if (!NIL_P(v) && !(ecflags & ECONV_INVALID_REPLACE)) { + ecflags |= ECONV_UNDEF_REPLACE; + } + v = rb_hash_aref(opt, sym_xml); if (!NIL_P(v)) { if (v==sym_text) { |