def psycopg2_async_set_client_encoding(conn, encoding): from psycopg2cffi._impl import encodings as _enc encoding = _enc.normalize(encoding) if conn.encoding == encoding: return pyenc = _enc.encodings[encoding] conn._encoding = encoding conn._py_enc = pyenc
def set_client_encoding(self, encoding): encoding = _enc.normalize(encoding) if self.encoding == encoding: return pyenc = _enc.encodings[encoding] self._rollback() self._set_guc('client_encoding', encoding) self._encoding = encoding self._py_enc = pyenc
def _get_encoding(self): """Retrieving encoding""" client_encoding = self.get_parameter_status('client_encoding') self._encoding = _enc.normalize(client_encoding) self._py_enc = _enc.encodings[self._encoding]