Method: SQLite3::Database#encoding
- Defined in:
- ext/sqlite3/database.c
#encoding ⇒ Object
Fetch the encoding set on this database
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 |
# File 'ext/sqlite3/database.c', line 750
static VALUE db_encoding(VALUE self)
{
sqlite3RubyPtr ctx;
VALUE enc;
Data_Get_Struct(self, sqlite3Ruby, ctx);
REQUIRE_OPEN_DB(ctx);
enc = rb_iv_get(self, "@encoding");
if(NIL_P(enc)) {
sqlite3_exec(ctx->db, "PRAGMA encoding", enc_cb, (void *)self, NULL);
}
return rb_iv_get(self, "@encoding");
}
|