pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
codepage
2+ messages / 1 participants
[nested] [flat]

* codepage
@ 2006-04-26 17:29  Patrick Welche <prlw1@newn.cam.ac.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Patrick Welche @ 2006-04-26 17:29 UTC (permalink / raw)
  To: pgsql-odbc

I came across the traditional

ERROR:  conversion between latin9 and LATIN1 is not supported

and read the thread latin1/latin9 in this list. The underlying
answer is essentially

http://www.postgresql.org/docs/8.1/static/multibyte.html#AEN22506

iso_8859_1_to_utf8 exists, and utf8_to_iso_8859_15 exists but not
iso_8859_1_to_8859_15, and "create conversion" as the documentation
page suggests might help.

But(!) I then wondered where the latin9 came from, and it seems to be
from:

                        case 1252:       
                                if (PG_VERSION_GE(self, 7.2))    
                                        wenc = "latin9";         
                                else     
                                        wenc = "latin1";         
                                break;   

in multibyte.c. (I'm looking at psqlodbc-08.01.0200 and running 8.2devel)

Why latin9? WIN1252 does exist (not sure when it was created - 8.1 same
as WIN1251?)

Cheers,

Patrick



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* codepage
@ 2006-05-04 16:01  Patrick Welche <prlw1@newn.cam.ac.uk>
  0 siblings, 0 replies; 2+ messages in thread

From: Patrick Welche @ 2006-05-04 16:01 UTC (permalink / raw)
  To: pgsql-odbc

Looking yet further at

   ERROR:  conversion between latin9 and LATIN1 is not supported

mulitbyte.c looks as though it needs the included patch, because
support for WIN1252 encoding was added to the server on 2005/03/14
so was released with 8.1 (2005/11/08), and because latin9 is a
worse match for win1252 than latin1.

e.g., your windows client with win1252 sends a 1/2 character, 0xbd to
a 8.1 server. The odbc code says 8.1>=7.1, I'll send 0xbd as latin9.
But, 0xbd in latin9 is oe. 0xbd in latin1 is 1/2 and what you would
expect.

Some might say "ah but the euro symbol which exists in win1252 exists
in latin9 but not in latin1". OK, but I would you represent it?
In win1252, euro is 0x80. Send 0x80 as latin1 or latin9, get nothing -
it's in the 0x80-0x9f control character range.

Thoughts?

Cheers,

Patrick

Attachments:

mb.pat (text/plain, 501B) download Index: multibyte.c =================================================================== RCS file: /cvsroot/psqlodbc/psqlodbc/multibyte.c,v retrieving revision 1.44 diff -u -r1.44 multibyte.c --- multibyte.c 27 Apr 2006 14:49:04 -0000 1.44 +++ multibyte.c 4 May 2006 15:50:56 -0000 @@ -424,8 +424,8 @@ case 1252: if (oldenc) ; - else if (PG_VERSION_GE(conn, 7.2)) - wenc = "latin9"; + else if (PG_VERSION_GE(conn, 8.1)) + wenc = "WIN1252"; else wenc = "latin1"; break;
^ permalink raw reply [nested|flat] 2+ messages in thread


end of thread, other threads:[~2006-05-04 16:01 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-04-26 17:29 codepage Patrick Welche <prlw1@newn.cam.ac.uk>
2006-05-04 16:01 codepage Patrick Welche <prlw1@newn.cam.ac.uk>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox