Thread: Multibyte ODBC

Multibyte ODBC

From
Dave Page
Date:
Hiroshi, please disregard my earlier email requesting a precompiled MB copy
of the driver - I found Eiji Tokuya's download.

I have now tried the following tests using my own compilation of the MB
driver and Eiji's:

1) Created a unicode database in 7.2/cygwin and loaded Jean-Michel's
Japanese test table.

2) Created a datasource, and added SET CLIENT_ENCODING='SJIS' to the connect
settings.

3) Linked the test table from Microsoft Access XP.

4) Using the Arial Unicode MS font, the data in Access looks like garbage.

5) Similar tests using the pgAdmin data grid yield the same results (as
expected 'cos it's VB).

I also copied Jean-Michel's test data into an html file so I could see what
it should look like. If I copy some Japanese chars into an Access table, it
works fine, however, if I copy them into the linked table, they get
converted to ????.

I was also getting the following message in the console:

NOTICE:  utf_to_local: could not convert UTF-8 (0xc3a9). Ignored

Any ideas anyone?

Regards, Dave.

Re: Multibyte ODBC

From
Jean-Michel POURE
Date:
Le Mercredi 27 Février 2002 14:24, Dave Page a écrit :
> 2) Created a datasource, and added SET CLIENT_ENCODING='SJIS' to the
> connect settings.

If you are using a full Unicode chain (PostgreSQL, ODBC, AccessXP), try SET
CLIENT_ENCODING='UNICODE', otherwise this will not work. If it does not work,
try again with the old ODBC driver.

UTF-8 chains are simple ASCII chains which should pass through the usual odbc
driver.

Cheers,
Jean-Michel

Re: Multibyte ODBC

From
Dave Page
Date:

> -----Original Message-----
> From: Jean-Michel POURE [mailto:jm.poure@freesurf.fr]
> Sent: 27 February 2002 13:29
> To: Dave Page
> Cc: 'Hiroshi Inoue'; pgadmin-hackers@postgresql.org;
> pgsql-odbc@postgresql.org
> Subject: Re: Multibyte ODBC
>
>
> Le Mercredi 27 Février 2002 14:24, Dave Page a écrit :
> > 2) Created a datasource, and added SET
> CLIENT_ENCODING='SJIS' to the
> > connect settings.
>
> If you are using a full Unicode chain (PostgreSQL, ODBC,
> AccessXP), try SET
> CLIENT_ENCODING='UNICODE', otherwise this will not work. If
> it does not work,
> try again with the old ODBC driver.

Nope, no difference.

> UTF-8 chains are simple ASCII chains which should pass
> through the usual odbc
> driver.

Yes, I think they are (passing through that is), they're just not being
interpreted correctly by the client (I guess).

Regards, Dave.

Re: Multibyte ODBC

From
Hiroshi Inoue
Date:
Dave Page wrote:
>
> Hiroshi, please disregard my earlier email requesting a precompiled MB copy
> of the driver - I found Eiji Tokuya's download.
>
> I have now tried the following tests using my own compilation of the MB
> driver and Eiji's:
>
> 1) Created a unicode database in 7.2/cygwin and loaded Jean-Michel's
> Japanese test table.
>
> 2) Created a datasource, and added SET CLIENT_ENCODING='SJIS' to the connect
> settings.
>
> 3) Linked the test table from Microsoft Access XP.
>
> 4) Using the Arial Unicode MS font, the data in Access looks like garbage.

You need to set the *Japanese* locale if you'd like to
display Japanese using SJIS.

regards,
Hiroshi Inoue

Re: [ODBC] Multibyte ODBC

From
Jean-Michel POURE
Date:
Dear Dave,

UTF-8 / AccessXP Japanese problem :

- Try import the linked dobc table into an Access table. Can you display the
Japanese glyphs? Did you write you could also display the glyphs when
copying/pasting into a table?

- If AccessXP can display the data from its tables and not from ODBC, it may
be because some "header" information are needed in the ODBC stream (example :
invisible characters at the beginning of file).

This idea comes to me because in HTML, you need to tell the browser to switch
to UTF-8 display (in header information), otherwize IE5 is not smart enought
to understand the ASCII characters are plain UTF-8. Maybe AccessXP is like
IE5... But I may be wrong...

Can you display the glyphs now?

Cheers,
Jean-Michel

Re: Multibyte ODBC

From
Dave Page
Date:

> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp]
> Sent: 27 February 2002 23:45
> To: Dave Page
> Cc: 'jm.poure@freesurf.fr'; pgadmin-hackers@postgresql.org;
> pgsql-odbc@postgresql.org
> Subject: Re: [pgadmin-hackers] Multibyte ODBC
>
>
> Dave Page wrote:
> >
> > Hiroshi, please disregard my earlier email requesting a
> precompiled MB
> > copy of the driver - I found Eiji Tokuya's download.
> >
> > I have now tried the following tests using my own
> compilation of the
> > MB driver and Eiji's:
> >
> > 1) Created a unicode database in 7.2/cygwin and loaded
> Jean-Michel's
> > Japanese test table.
> >
> > 2) Created a datasource, and added SET
> CLIENT_ENCODING='SJIS' to the
> > connect settings.
> >
> > 3) Linked the test table from Microsoft Access XP.
> >
> > 4) Using the Arial Unicode MS font, the data in Access looks like
> > garbage.
>
> You need to set the *Japanese* locale if you'd like to
> display Japanese using SJIS.

Please excuse my ignorance on this one Hiroshi, but just about everything I
read is getting me more confused :-(

I assume by locale, in this context you mean Windows local - what it calls
it's regional settings? If so, I think this is still a problem because what
we are trying to achieve (at least in Access as it seems VB won't do it) is
display of multiple languages at once. For example, in a fictional case
someone may have a Unicode database that may contain data in Japanese
(UTF-8), French, English and maybe other languages (Jean-Michel may even be
in this situation now).

Access can do this quite happily with it's native tables (with no locale
changes), it's just the linked PostgreSQL tables that don't want to work
:-(.

Regards, Dave


Re: Multibyte ODBC

From
Hiroshi Inoue
Date:
Dave Page wrote:
>
> > -----Original Message-----
> > From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp]
> >
> > Dave Page wrote:
> > >
> > > 4) Using the Arial Unicode MS font, the data in Access looks like
> > > garbage.
> >
> > You need to set the *Japanese* locale if you'd like to
> > display Japanese using SJIS.
>
> Please excuse my ignorance on this one Hiroshi, but just about everything I
> read is getting me more confused :-(
>
> I assume by locale, in this context you mean Windows local - what it calls
> it's regional settings?

Yes you have to localize your environment(application) to
use a specific encoding like SJIS.

> If so, I think this is still a problem because what
> we are trying to achieve (at least in Access as it seems VB won't do it) is
> display of multiple languages at once. For example, in a fictional case
> someone may have a Unicode database that may contain data in Japanese
> (UTF-8), French, English and maybe other languages (Jean-Michel may even be
> in this situation now).
>
> Access can do this quite happily with it's native tables (with no locale
> changes),

Windows applications are very happy as long as they
live in the Windows world because Windows(NT/2000/XP)
is a world of Unicode(UCS-2).

> it's just the linked PostgreSQL tables that don't want to work
> :-(.

I hope Unicode(UCS-2) support for our ODBC driver would
solve it though I couldn't guarantee when it would be
ready.

regards,
Hiroshi Inoue

Re: Multibyte ODBC

From
Dave Page
Date:

> -----Original Message-----
> From: Hiroshi Inoue [mailto:Inoue@tpf.co.jp]
> Sent: 28 February 2002 23:50
> To: Dave Page
> Cc: 'jm.poure@freesurf.fr'; pgadmin-hackers@postgresql.org;
> pgsql-odbc@postgresql.org
> Subject: Re: [pgadmin-hackers] Multibyte ODBC
>
> I hope Unicode(UCS-2) support for our ODBC driver would
> solve it though I couldn't guarantee when it would be
> ready.

Thanks Hirsohi - with your help and a *lot* of reading of documentation, I
think I've now got my head around all this. My conclusion was also that the
ODBC driver needs UCS-2 support to do what we require (specifically the
SQL*W functions as I understood it).

Thanks again,

Regards, Dave.