From f453c3c0dadd093518335f75a2bb8ec50a283afb Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 5 Mar 2010 10:39:56 +0000 Subject: * 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 --- transcode.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'transcode.c') 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) { -- cgit v1.2.3