@@ -666,38 +666,6 @@ static VALUE enable_load_extension(VALUE self, VALUE onoff)
666666}
667667#endif
668668
669- static int enc_cb (void * _self , int UNUSED (columns ), char * * data , char * * UNUSED (names ))
670- {
671- VALUE self = (VALUE )_self ;
672-
673- int index = rb_enc_find_index (data [0 ]);
674- rb_encoding * e = rb_enc_from_index (index );
675- rb_iv_set (self , "@encoding" , rb_enc_from_encoding (e ));
676-
677- return 0 ;
678- }
679-
680- /* call-seq: db.encoding
681- *
682- * Fetch the encoding set on this database
683- */
684- static VALUE db_encoding (VALUE self )
685- {
686- sqlite3RubyPtr ctx ;
687- VALUE enc ;
688-
689- TypedData_Get_Struct (self , sqlite3Ruby , & database_type , ctx );
690- REQUIRE_OPEN_DB (ctx );
691-
692- enc = rb_iv_get (self , "@encoding" );
693-
694- if (NIL_P (enc )) {
695- sqlite3_exec (ctx -> db , "PRAGMA encoding" , enc_cb , (void * )self , NULL );
696- }
697-
698- return rb_iv_get (self , "@encoding" );
699- }
700-
701669/* call-seq: db.transaction_active?
702670 *
703671 * Returns +true+ if there is a transaction active, and +false+ otherwise.
@@ -868,8 +836,6 @@ void init_sqlite3_database(void)
868836 rb_define_method (cSqlite3Database , "enable_load_extension" , enable_load_extension , 1 );
869837#endif
870838
871- rb_define_method (cSqlite3Database , "encoding" , db_encoding , 0 );
872-
873839 rb_sqlite3_aggregator_init ();
874840}
875841
0 commit comments