We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent deecab9 commit 220c194Copy full SHA for 220c194
ext/sqlite3/database.c
@@ -288,7 +288,14 @@ static VALUE sqlite3val2rb(sqlite3_value * val)
288
which is what we want, as blobs are binary
289
*/
290
int len = sqlite3_value_bytes(val);
291
+#ifdef HAVE_RUBY_ENCODING_H
292
return rb_tainted_str_new((const char *)sqlite3_value_blob(val), len);
293
+#else
294
+ /* When encoding is not available, make it class SQLite3::Blob. */
295
+ VALUE strargv[1];
296
+ strargv[0] = rb_tainted_str_new((const char *)sqlite3_value_blob(val), len);
297
+ return rb_class_new_instance(1, strargv, cSqlite3Blob);
298
+#endif
299
break;
300
}
301
case SQLITE_NULL:
0 commit comments