Unix Technical Forum

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

This is a discussion on Re: Bug or not about ASCII and Multi-Byte character set within the pgsql Interfaces odbc forums, part of the PostgreSQL category; --> As I have said a number of times now, DO NOT USE ASCII FOR NON-ASCII DATA!!! Whilst some apps ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Interfaces odbc

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-16-2008, 02:20 AM
Dave Page
 
Posts: n/a
Default Re: Bug or not about ASCII and Multi-Byte character set


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.Springer@JOOPS.COM>
Sent: 14/08/05 18:49:49
To: "ZF"<zf.tech@gmail.com>
Cc: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.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 Grüssen,
Josef Springer
(Gescha"ftsleitung)

<cidart1.05000701.06060503@netscape.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.Springer@joops.com <mailto:Josef.Springer@joops.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 Grüssen,
Josef Springer
(Gescha"ftsleitung)

<cidart1.05000701.06060503@netscape.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.Springer@joops.com <mailto:Josef.Springer@joops.com>
Website http://www.joops.com



---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-16-2008, 02:20 AM
Ben Trewern
 
Posts: n/a
Default Re: Bug or not about ASCII and Multi-Byte character set

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@vale-housing.co.uk> wrote in message
news:000101c5a10a$d47e0e02$6a01a8c0@valehousing.co .uk...
>
> 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.Springer@JOOPS.COM>
> Sent: 14/08/05 18:49:49
> To: "ZF"<zf.tech@gmail.com>
> Cc: "pgsql-odbc@postgresql.org"<pgsql-odbc@postgresql.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 Grüssen,
> Josef Springer
> (Gescha"ftsleitung)
>
> <cidart1.05000701.06060503@netscape.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.Springer@joops.com <mailto:Josef.Springer@joops.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 Grüssen,
> Josef Springer
> (Gescha"ftsleitung)
>
> <cidart1.05000701.06060503@netscape.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.Springer@joops.com <mailto:Josef.Springer@joops.com>
> Website http://www.joops.com
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 06:15 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com