Skip to content

Commit 1281d46

Browse files
nyaxtjustincase
authored andcommitted
support ruby w/o Encoding
1 parent 941e5ed commit 1281d46

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ext/mysql2/statement.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@ static VALUE execute(int argc, VALUE *argv, VALUE self) {
265265
break;
266266
case T_STRING:
267267
{
268-
params_enc[i] = rb_str_export_to_enc(argv[i], conn_enc);
268+
params_enc[i] = argv[i];
269+
#ifdef HAVE_RUBY_ENCODING_H
270+
params_enc[i] = rb_str_export_to_enc(params_enc[i], conn_enc);
271+
#endif
269272
bind_buffers[i].buffer_type = MYSQL_TYPE_STRING;
270273
bind_buffers[i].buffer = RSTRING_PTR(params_enc[i]);
271274
bind_buffers[i].buffer_length = RSTRING_LEN(params_enc[i]);

0 commit comments

Comments
 (0)