Bug ref: 1262
authorDave Page <[email protected]>
Wed, 27 Apr 2005 10:34:00 +0000 (10:34 +0000)
committerDave Page <[email protected]>
Wed, 27 Apr 2005 10:34:00 +0000 (10:34 +0000)
When specifiying a client_encoding, the driver will always use UTF-8.
The problem is in connection.c, line number 1024, the code that reads:

if (!self->client_encoding || stricmp(self->client_encoding, "UNICODE"))

should read:

if (!self->client_encoding || !stricmp(self->client_encoding, "UNICODE"))

(the check with stricmp will always be true when client_encoding is different from UNICODE, not when it is UNICODE, wich is what's intended).
[melkor <NOSPAM> odyssey.com.uy]

connection.c

index 34a0a2bfe19dc6ce360bb5c8ea338fac6739b0aa..deda5808d97703e5abc1dbd740ab592f6092a1f5 100644 (file)
@@ -1022,7 +1022,7 @@ another_version_retry:
        if (self->unicode)
        {
            if (!self->client_encoding ||
-               stricmp(self->client_encoding, "UNICODE"))
+               !stricmp(self->client_encoding, "UNICODE"))
            {
                QResultClass    *res;
                if (PG_VERSION_LT(self, 7.1))