ext/pg_connection.c in pg-0.13.0.pre298 vs ext/pg_connection.c in pg-0.13.0.pre300

- old
+ new

@@ -1,8 +1,8 @@ /* * pg_connection.c - PG::Connection class extension - * $Id: pg_connection.c,v 1cdad2ce8993 2012/01/25 01:21:30 ged $ + * $Id: pg_connection.c,v b67309d3ccf2 2012/01/27 04:14:07 ged $ * */ #include "pg.h" @@ -2346,22 +2346,10 @@ { char *encoding = (char *)pg_encoding_to_char(PQclientEncoding(pg_get_pgconn(self))); return rb_tainted_str_new2(encoding); } -/* - * call-seq: - * conn.client_encoding() -> Encoding - * - * Returns the client encoding as an Encoding object. - */ -static VALUE -pgconn_client_encoding(VALUE self) -{ - rb_encoding *enc = pg_conn_enc_get( pg_get_pgconn(self) ); - return rb_enc_from_encoding( enc ); -} /* * call-seq: * conn.set_client_encoding( encoding ) * @@ -2373,11 +2361,11 @@ PGconn *conn = pg_get_pgconn( self ); Check_Type(str, T_STRING); if ( (PQsetClientEncoding(conn, StringValuePtr(str))) == -1 ) { - rb_raise(rb_ePGerror, "invalid f'ing encoding name: %s",StringValuePtr(str)); + rb_raise(rb_ePGerror, "invalid encoding name: %s",StringValuePtr(str)); } return Qnil; } @@ -3247,11 +3235,10 @@ /****** PG::Connection INSTANCE METHODS: Notice Processing ******/ rb_define_method(rb_cPGconn, "set_notice_receiver", pgconn_set_notice_receiver, 0); rb_define_method(rb_cPGconn, "set_notice_processor", pgconn_set_notice_processor, 0); /****** PG::Connection INSTANCE METHODS: Other ******/ - rb_define_method(rb_cPGconn, "client_encoding", pgconn_client_encoding, 0); rb_define_method(rb_cPGconn, "get_client_encoding", pgconn_get_client_encoding, 0); rb_define_method(rb_cPGconn, "set_client_encoding", pgconn_set_client_encoding, 1); rb_define_alias(rb_cPGconn, "client_encoding=", "set_client_encoding"); rb_define_method(rb_cPGconn, "transaction", pgconn_transaction, 0); rb_define_method(rb_cPGconn, "block", pgconn_block, -1); @@ -3288,10 +3275,10 @@ rb_define_method(rb_cPGconn, "lo_close",pgconn_loclose, 1); rb_define_alias(rb_cPGconn, "loclose", "lo_close"); rb_define_method(rb_cPGconn, "lo_unlink", pgconn_lounlink, 1); rb_define_alias(rb_cPGconn, "lounlink", "lo_unlink"); -#ifdef M17N_SUPPORTED +#ifdef M17N_SUPPORTED rb_define_method(rb_cPGconn, "internal_encoding", pgconn_internal_encoding, 0); rb_define_method(rb_cPGconn, "internal_encoding=", pgconn_internal_encoding_set, 1); rb_define_method(rb_cPGconn, "external_encoding", pgconn_external_encoding, 0); #endif /* M17N_SUPPORTED */