From f453c3c0dadd093518335f75a2bb8ec50a283afb Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 5 Mar 2010 10:39:56 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ transcode.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1028a8e845..4fb961a04f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Mar 5 19:36:12 2010 NARUSE, Yui + + * 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 * 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) {