Re: Bug or not about ASCII and Multi-Byte character set

From: "Ben Trewern" <ben(dot)trewern(at)_nospam_mowlem(dot)com>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: Bug or not about ASCII and Multi-Byte character set
Date: 2005-08-15 12:43:52
Message-ID: ddq2g1$2rk3$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

I'd like to make a few points on this issue.

1. This problem should be mentioned in the FAQs as largely as possible as
it is difficult to rectify if you have fallen into this trap.

2. If you do have data in SQL_ASCII the old ODBC driver worked, PgAdmin III
works, Delphi and zeoslib works, I understand why there may be a problem but
is it not possible to make the new 8.x work?

3. Correct me if I'm wrong but SQL_ASCII is PostgreSQL's default encoding.
If this isn't sorted out then we'll see lots more of these messages for
help.

4. I'd like to disagree with your "DO NOT USE ASCII FOR NON-ASCII DATA" as
if you read any of Tom Lanes many messages on the subject. Here's a quote:

"The SQL_ASCII setting isn't an
encoding, really; it's a declaration of ignorance. In this setting
the server will just store and regurgitate whatever character strings
you send it. This will work fine, more or less, if all your clients
use exactly the same encoding and you don't care about functions like
upper()/lower()"

It should be possible to use SQL_ASCII and get out what you put in. That's
how I read the above statement and at the moment the 8.0 version of the ODBC
driver doesn't to that. I only wish I knew enough C to look into this and
make an attemp at fixing this problem.

Regards,

Ben

""Dave Page"" <dpage(at)vale-housing(dot)co(dot)uk> wrote in message
news:000101c5a10a$d47e0e02$6a01a8c0(at)valehousing(dot)co(dot)uk(dot)(dot)(dot)
>
> As I have said a number of times now, DO NOT USE ASCII FOR NON-ASCII
> DATA!!!
>
> Whilst some apps like pgAdmin may do what you expect, other apps and
> interfaces may not.
>
> Instead of ASCII, use the correct encoding for your data, or try Unicode
> if unsure.
>
> Regards, Dave
>
> -----Original Message-----
> From: "Josef Springer"<Josef(dot)Springer(at)JOOPS(dot)COM>
> Sent: 14/08/05 18:49:49
> To: "ZF"<zf(dot)tech(at)gmail(dot)com>
> Cc: "pgsql-odbc(at)postgresql(dot)org"<pgsql-odbc(at)postgresql(dot)org>
> Subject: Re: [ODBC] Bug or not about ASCII and Multi-Byte character set
>
> Multibyte characters are written correctly but readed wrong by the ODBC
> driver. Seems to work on WinXP clients right. Only Win2k clients may
> have this problem. This bug may be corrected in PostgreSQL 8.1.
>
> Josef Springer
>
> ZF wrote:
>
>>version: psqlodbc 08.00.0101 and 08.00.0102
>>
>>The server database encoding is ASCII in win2000. After inserting several
>>multi-byte characters with pgAdmin3(version: 1.2.1), i found the odbc
>>driver can't provide the right data (application is written in visual c++
>>and call ODBC API to access db server). All displayed multi-byte char set
>>data were not correct but the ASCII data was right. However, pgAdmin3 can
>>correctly insert and select all data .
>>
>>Then i read the "mylog" file and found the multi-byte data have been got
>>correctly from server.
>>Is it possible that some function (maybe the converting function) have a
>>little bug?
>>
>>
>>P.S.
>>if the server db encoding is UNICODE and producing a new psqlodbc.dll
>>through deleting all SQL*W function in 'psqlodbc_win32.def' file, i got
>>Delphi applications using odbc driver can show all right data.
>>---------------------------(end of broadcast)---------------------------
>>TIP 9: In versions below 8.0, the planner will ignore your desire to
>> choose an index scan if your joining column's datatypes do not
>> match
>>
>
> --
>
> mit freundlichen Grssen,
> Josef Springer
> (Gescha"ftsleitung)
>
> <cid:part1(dot)05000701(dot)06060503(at)netscape(dot)com> -- the software company --
>
> Orlando-di-Lasso Str. 2
> D-85640 Putzbrunn
>
> Tel. ++49(0)89 600 6920
> Fax ++49(0)89 600 69220
> mailto Josef(dot)Springer(at)joops(dot)com <mailto:Josef(dot)Springer(at)joops(dot)com>
> Website http://www.joops.com
>
>
>
>
>
> -----Unmodified Original Message-----
> Multibyte characters are written correctly but readed wrong by the ODBC
> driver. Seems to work on WinXP clients right. Only Win2k clients may
> have this problem. This bug may be corrected in PostgreSQL 8.1.
>
> Josef Springer
>
> ZF wrote:
>
>>version: psqlodbc 08.00.0101 and 08.00.0102
>>
>>The server database encoding is ASCII in win2000. After inserting several
>>multi-byte characters with pgAdmin3(version: 1.2.1), i found the odbc
>>driver can't provide the right data (application is written in visual c++
>>and call ODBC API to access db server). All displayed multi-byte char set
>>data were not correct but the ASCII data was right. However, pgAdmin3 can
>>correctly insert and select all data .
>>
>>Then i read the "mylog" file and found the multi-byte data have been got
>>correctly from server.
>>Is it possible that some function (maybe the converting function) have a
>>little bug?
>>
>>
>>P.S.
>>if the server db encoding is UNICODE and producing a new psqlodbc.dll
>>through deleting all SQL*W function in 'psqlodbc_win32.def' file, i got
>>Delphi applications using odbc driver can show all right data.
>>---------------------------(end of broadcast)---------------------------
>>TIP 9: In versions below 8.0, the planner will ignore your desire to
>> choose an index scan if your joining column's datatypes do not
>> match
>>
>
> --
>
> mit freundlichen Grssen,
> Josef Springer
> (Gescha"ftsleitung)
>
> <cid:part1(dot)05000701(dot)06060503(at)netscape(dot)com> -- the software company --
>
> Orlando-di-Lasso Str. 2
> D-85640 Putzbrunn
>
> Tel. ++49(0)89 600 6920
> Fax ++49(0)89 600 69220
> mailto Josef(dot)Springer(at)joops(dot)com <mailto:Josef(dot)Springer(at)joops(dot)com>
> Website http://www.joops.com
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>

In response to

Browse pgsql-odbc by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2005-08-16 09:18:32 Re: Implementing IPv6 ...
Previous Message Merlin Moncure 2005-08-15 11:55:33 Re: New libpq based driver snapshot 08.01.0003 available