+ {
+ const int enc = PQclientEncoding (r->conn);
+
+ /* According to section 22.2 of the Postgresql manual
+ a value of zero (SQL_ASCII) indicates
+ "a declaration of ignorance about the encoding".
+ Accordingly, we don't set the dictionary's encoding
+ if we find this value.
+ */
+ if ( enc != 0 )
+ dict_set_encoding (r->dict, pg_encoding_to_char (enc));
+ }
+