summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-05 10:39:56 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-03-05 10:39:56 +0000
commitf453c3c0dadd093518335f75a2bb8ec50a283afb (patch)
tree2b920e59d60f22bc5c10ae132a948ad6dae597a4
parent4bcae18e375dcfc880be52f7b89ef2d45f75b57b (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--ChangeLog5
-rw-r--r--transcode.c5
2 files changed, 10 insertions, 0 deletions
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 <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) {