* client encoding and server internal encoding.
* (currently mule internal code (mic) is used)
* Tatsuo Ishii
- * $Id: mbutils.c,v 1.20 2001/09/06 04:57:29 ishii Exp $
+ * $Id: mbutils.c,v 1.21 2001/09/08 14:30:15 momjian Exp $
*/
#include "postgres.h"
Assert(DatabaseEncoding);
if (ClientEncoding == NULL)
- {
/* this is the first time */
ClientEncoding = DatabaseEncoding;
- }
+
return (ClientEncoding->encoding);
}
Assert(DatabaseEncoding);
if (ClientEncoding == NULL)
- {
/* this is the first time */
ClientEncoding = DatabaseEncoding;
- }
+
return (ClientEncoding->name);
}
unsigned char *
pg_client_to_server(unsigned char *s, int len)
{
- Assert(ClientEncoding);
Assert(DatabaseEncoding);
+ if (ClientEncoding == NULL)
+ /* this is the first time */
+ ClientEncoding = DatabaseEncoding;
+
if (ClientEncoding->encoding == DatabaseEncoding->encoding)
return s;
unsigned char *
pg_server_to_client(unsigned char *s, int len)
{
- Assert(ClientEncoding);
Assert(DatabaseEncoding);
+ if (ClientEncoding == NULL)
+ /* this is the first time */
+ ClientEncoding = DatabaseEncoding;
+
if (ClientEncoding->encoding == DatabaseEncoding->encoding)
return s;