summaryrefslogtreecommitdiff
path: root/ext/cgi/escape
diff options
context:
space:
mode:
Diffstat (limited to 'ext/cgi/escape')
-rw-r--r--ext/cgi/escape/escape.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/cgi/escape/escape.c b/ext/cgi/escape/escape.c
index 7289f43b8d..fa3d6c2038 100644
--- a/ext/cgi/escape/escape.c
+++ b/ext/cgi/escape/escape.c
@@ -252,7 +252,8 @@ optimized_unescape(VALUE str, VALUE encoding)
long i, len, beg = 0;
VALUE dest = 0;
const char *cstr;
- int cr, origenc, encidx = rb_to_encoding_index(encoding);
+ rb_encoding *enc = rb_to_encoding(encoding);
+ int cr, origenc, encidx = rb_enc_to_index(enc);
len = RSTRING_LEN(str);
cstr = RSTRING_PTR(str);