Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 3DB38632524 for ; Fri, 23 Jan 2009 09:11:37 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 58247-03 for ; Fri, 23 Jan 2009 09:11:32 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f11.google.com (mail-fx0-f11.google.com [209.85.220.11]) by mail.postgresql.org (Postfix) with ESMTP id BA3EC6323E9 for ; Fri, 23 Jan 2009 09:11:31 -0400 (AST) Received: by fxm4 with SMTP id 4so1294114fxm.19 for ; Fri, 23 Jan 2009 05:11:30 -0800 (PST) MIME-Version: 1.0 Received: by 10.181.139.10 with SMTP id r10mr289348bkn.11.1232715858641; Fri, 23 Jan 2009 05:04:18 -0800 (PST) Date: Fri, 23 Jan 2009 14:04:18 +0100 Message-ID: <93d3a1c90901230504u19f6dafau4c04a88aefef55d1@mail.gmail.com> Subject: Localized error messages, wrong charset From: Kenneth Lundin To: pgsql-odbc@postgresql.org Content-Type: multipart/alternative; boundary=001636499f6ddd030104612606e0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 200901/19 X-Sequence-Number: 9758 --001636499f6ddd030104612606e0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, i'm coding a project in C# / VS2008 and i'm using postgres/ODBC for database connectivity. Everthing works fine except for one tiny detail, and that is that i'm having trouble with OdbcExceptions and the Message property. It seems that the Message is not in the expected charset since all swedish characters are turned into box-like characters when they are displayed in a normal MessageBox control. I'm not sure which charset windows is using internally since that is sort of invisible to the programmer, but i would have assumed it is using some sort of unicode strings. Anyway, either the OdbcException.Message property does not return a UTF-8 string, OR it does return a UTF-8 string and Windows can not use that (but I think it is the first alternative, because if it would have returned UTF-8, there would have been several box-like characters per "real" character, and currently there is a one-to-one match). Everywhere else, unicode/UTF-8 strings works beautifully, in Sorting, LIKE, ILIKE etc throughout the application, and it also looks correctly when i'm looking at the data using pgAdmin, so it's only the error messages that does not work. Does anyone have any experience in this and want to share with me on this one? BTW, i'm using the "PostgreSQL Unicode" ODBC driver. //Kenneth --001636499f6ddd030104612606e0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,
 
i'm coding a project in C# / VS2008 and i'm using postgre= s/ODBC for database connectivity. Everthing works fine except for one tiny = detail, and that is that i'm having trouble with OdbcExceptions and the= Message property. It seems that the Message is not in the expected charset= since all swedish characters are turned into box-like characters when they= are displayed in a normal MessageBox control. I'm not sure which chars= et windows is using internally since that is sort of invisible to the progr= ammer, but i would have assumed it is using some sort of unicode strings.
 
Anyway, either the OdbcException.Message property does not return a UT= F-8 string, OR it does return a UTF-8 string and Windows can not use that (= but I think it is the first alternative, because if it would have returned = UTF-8, there would have been several box-like characters per "real&quo= t; character, and currently there is a one-to-one match).
 
Everywhere else, unicode/UTF-8 strings works beautifully, in Sort= ing, LIKE, ILIKE etc throughout the application, and it also looks cor= rectly when i'm looking at the data using pgAdmin, so it's only the= error messages that does not work.
 
Does anyone have any experience in this and want to share wi= th me on this one?
 
BTW, i'm using the "PostgreSQL Unicode" ODBC driver.
 
//Kenneth
 
--001636499f6ddd030104612606e0--