Localized error messages, wrong charset

Localized error messages, wrong charset

am 23.01.2009 14:04:18 von Kenneth Lundin

--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. div>

 

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. v>
 

//Kenneth

 


--001636499f6ddd030104612606e0--

Re: Localized error messages, wrong charset

am 24.01.2009 00:43:13 von Hiroshi Inoue

Hi Kenneth,

Kenneth Lundin wrote:
> 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.

Could you send me directly the Mylog output ?

regards,
Hiroshi Inoue

--
Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-odbc