summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/string.c b/string.c
index 16df6021d7..fae5978325 100644
--- a/string.c
+++ b/string.c
@@ -473,7 +473,7 @@ RUBY_ALIAS_FUNCTION(rb_tainted_str_new2(const char *ptr), rb_tainted_str_new_cst
#define rb_tainted_str_new2 rb_tainted_str_new_cstr
VALUE
-rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
+rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts)
{
rb_econv_t *ec;
rb_econv_result_t ret;
@@ -497,7 +497,7 @@ rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
newstr = rb_str_new(0, len);
retry:
- ec = rb_econv_open_opts(from->name, to->name, 0, Qnil);
+ ec = rb_econv_open_opts(from->name, to->name, ecflags, ecopts);
if (!ec) return str;
sp = (unsigned char*)RSTRING_PTR(str);
@@ -525,6 +525,12 @@ rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
}
VALUE
+rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to)
+{
+ return rb_str_conv_enc_opts(str, from, to, 0, Qnil);
+}
+
+VALUE
rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *eenc)
{
VALUE str;