X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D8C2B3A3E85 for ; Tue, 4 Jan 2005 18:33:17 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 91788-04 for ; Tue, 4 Jan 2005 18:32:56 +0000 (GMT) Received: from hub.org (hub.org [200.46.204.220]) by svr1.postgresql.org (Postfix) with ESMTP id 5BE3B3A3EC4 for ; Tue, 4 Jan 2005 18:32:56 +0000 (GMT) Received: from localhost (unknown [200.46.204.144]) by hub.org (Postfix) with ESMTP id B018612925B for ; Tue, 4 Jan 2005 14:32:55 -0400 (AST) Received: from hub.org ([200.46.204.220]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 89866-09 for ; Tue, 4 Jan 2005 18:32:35 +0000 (GMT) Received: from ganymede.hub.org (blk-222-250-144.eastlink.ca [24.222.250.144]) by hub.org (Postfix) with ESMTP id 7CF1F129677 for ; Tue, 4 Jan 2005 14:32:33 -0400 (AST) Received: by ganymede.hub.org (Postfix, from userid 1000) id 1D7696034A; Tue, 4 Jan 2005 14:32:34 -0400 (AST) Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 1977960348 for ; Tue, 4 Jan 2005 14:32:34 -0400 (AST) X-Return-Path: X-Received: from localhost ([unix socket]) by ganymede.hub.org (Cyrus v2.2.10) with LMTPA; Tue, 04 Jan 2005 14:15:08 -0400 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (localhost [127.0.0.1]) by ganymede.hub.org (Postfix) with ESMTP id 81D5360085 for ; Tue, 4 Jan 2005 14:11:41 -0400 (AST) X-Received: from mail.postgresql.org [200.46.204.71] by localhost with IMAP (fetchmail-6.2.5) for scrappy@localhost (single-drop); Tue, 04 Jan 2005 14:11:41 -0400 (AST) X-Received: from svr1.postgresql.org ([unix socket]) by svr1.postgresql.org (Cyrus v2.2.10) with LMTPA; Tue, 04 Jan 2005 18:06:42 +0000 X-Sieve: CMU Sieve 2.2 X-Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 8D71D3A3EC5 for ; Tue, 4 Jan 2005 18:06:42 +0000 (GMT) X-Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 83462-10 for ; Tue, 4 Jan 2005 18:06:20 +0000 (GMT) X-Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by svr1.postgresql.org (Postfix) with ESMTP id 253133A2D7A for ; Tue, 4 Jan 2005 18:06:20 +0000 (GMT) X-Received: from [212.227.126.162] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1Clt4V-0005Ck-00 for psql-odbc@postgresql.org; Tue, 04 Jan 2005 19:06:19 +0100 X-Received: from [80.129.145.197] (helo=pse-consulting.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1Clt4V-0005Nv-00 for psql-odbc@postgresql.org; Tue, 04 Jan 2005 19:06:19 +0100 Message-ID: <41DADB1B.70402@pse-consulting.de> Date: Tue, 04 Jan 2005 18:06:19 +0000 From: Andreas Pflug User-Agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.6) Gecko/20040413 Debian/1.6-5 X-Accept-Language: en MIME-Version: 1.0 To: psql-odbc@postgresql.org Subject: conversion problem Content-Type: multipart/mixed; boundary="------------030805060001020709060703" X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:0ce7ee5c3478b8d72edd8e05ccd40b70 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-DCC: : X-Spam-Pyzor: ReSent-Date: Tue, 4 Jan 2005 14:32:29 -0400 (AST) Resent-From: "Marc G. Fournier" Resent-To: pgsql-odbc@postgresql.org ReSent-Subject: conversion problem ReSent-Message-ID: <20050104143229.D65737@ganymede.hub.org> X-Virus-Scanned: by amavisd-new at hub.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.946 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200501/10 X-Sequence-Number: 4805 This is a multi-part message in MIME format. --------------030805060001020709060703 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit When trying to insert strings with German umlaute (e.g. "täglich") into a text or varchar column, the server throws the message invalid byte sequence for encoding "UNICODE": 0xe4656c This results from ResolveOneParam not converting the string to UTF-8. Digging into this, I found that ipdopts->parameters[param_number].SQLType contains 0xffff, instead of something sensible for PGType=0x19 (text). The attached patch works as hotfix for me, but is certainly only a workaround for a problem buried deeper because SQLType seems bogus to me. OTOH, I don't understand why the switch(param_pgtype) was invented at all (the original patch I posted more than a year ago didn't have it), because any string coming from the app will probably need conversion to UTF-8 anyway. Regards, Andreas --------------030805060001020709060703 Content-Type: text/x-patch; name="convert.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="convert.c.patch" Index: convert.c =================================================================== RCS file: /usr/local/cvsroot/psqlodbc/psqlodbc/convert.c,v retrieving revision 1.121 diff -u -r1.121 convert.c --- convert.c 30 Jul 2004 21:08:12 -0000 1.121 +++ convert.c 4 Jan 2005 17:49:29 -0000 @@ -2621,6 +2621,7 @@ case SQL_WCHAR: case SQL_WVARCHAR: case SQL_WLONGVARCHAR: + case (Int2)0xffff: if (SQL_NTS == used) used = strlen(buffer); allocbuf = malloc(WCLEN * (used + 1)); --------------030805060001020709060703--