Thread: Problem with Chinese characters

Problem with Chinese characters

From
Mimi Siu
Date:
Hi:

I am using psqlodbc-08-00-0102 ODBC driver on my
Windows 2000 machine and want to insert data (with
chinese characters) to the postgresql 8.0.3 running on
RH9.

My database is encoded as UNICODE, and my sql
statement is already converted to UTF-8 before calling
SQLExecute(). But I found that the coding of the
chinese characters is not UTF-8 in the postgresql
database. Also if I insert the record with 10 chinese
characters, the length of the field should be 10, but
now it is 30.

It was previously work when I use the
psqlodbc-07-02-01 driver with postgresql 7.3.

Thanks a lot!



__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

Re: Problem with Chinese characters

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Mimi Siu
> Sent: 03 November 2005 10:03
> To: pgsql-odbc@postgresql.org
> Subject: [ODBC] Problem with Chinese characters
>
> Hi:
>
> I am using psqlodbc-08-00-0102 ODBC driver on my
> Windows 2000 machine and want to insert data (with
> chinese characters) to the postgresql 8.0.3 running on
> RH9.
>
> My database is encoded as UNICODE, and my sql
> statement is already converted to UTF-8 before calling
> SQLExecute(). But I found that the coding of the
> chinese characters is not UTF-8 in the postgresql
> database. Also if I insert the record with 10 chinese
> characters, the length of the field should be 10, but
> now it is 30.
>
> It was previously work when I use the
> psqlodbc-07-02-01 driver with postgresql 7.3.

Please try the latest snapshot - 08.01.0005. It has various fixes and
can be compiled in Unicode or ANSI/Multibyte mode as the older 07.xx
drivers could (08.00.xxxx was Unicode only).

Regards, Dave

Re: Problem with Chinese characters

From
Rainer Bauer
Date:
"Dave Page" schrieb:

>Please try the latest snapshot - 08.01.0005. It has various fixes and
>can be compiled in Unicode or ANSI/Multibyte mode as the older 07.xx
>drivers could (08.00.xxxx was Unicode only).

It least I could not compile it, because the resource file is in Japanese.
Or am I missing something?

Rainer

Re: Problem with Chinese characters

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Rainer Bauer
> Sent: 03 November 2005 10:41
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Problem with Chinese characters
>
> "Dave Page" schrieb:
>
> >Please try the latest snapshot - 08.01.0005. It has various fixes and
> >can be compiled in Unicode or ANSI/Multibyte mode as the older 07.xx
> >drivers could (08.00.xxxx was Unicode only).
>
> It least I could not compile it, because the resource file is
> in Japanese.
> Or am I missing something?

The resource file is in English and Japanese. If you cannot compile, why
not use the binaries though?

Regards, Dave

Re: Problem with Chinese characters

From
Rainer Bauer
Date:
"Dave Page" schrieb:

>> >Please try the latest snapshot - 08.01.0005. It has various fixes and
>> >can be compiled in Unicode or ANSI/Multibyte mode as the older 07.xx
>> >drivers could (08.00.xxxx was Unicode only).
>>
>> It least I could not compile it, because the resource file is
>> in Japanese.
>> Or am I missing something?
>
>The resource file is in English and Japanese. If you cannot compile, why
>not use the binaries though?

Mmmh. You are right. I tried to compile them on my Win9x machine and that's
why it failed. After removing the Japanese resources, it works.

I am already using the 8.1.005 binaries. However I wanted to run the driver in
debug mode to be able to give a better feedback (stack trace) if the driver
should crash.

BTW, using UseServerSidePrepare is not working. Is this the declare/fetch
issue you are currently tracking? If you need help in testing the driver, I
could check it against my application.

Rainer

Re: Problem with Chinese characters

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Rainer Bauer
> Sent: 03 November 2005 11:55
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Problem with Chinese characters
>
> "Dave Page" schrieb:
>
> >> >Please try the latest snapshot - 08.01.0005. It has
> various fixes and
> >> >can be compiled in Unicode or ANSI/Multibyte mode as the
> older 07.xx
> >> >drivers could (08.00.xxxx was Unicode only).
> >>
> >> It least I could not compile it, because the resource file is
> >> in Japanese.
> >> Or am I missing something?
> >
> >The resource file is in English and Japanese. If you cannot
> compile, why
> >not use the binaries though?
>
> Mmmh. You are right. I tried to compile them on my Win9x
> machine and that's
> why it failed. After removing the Japanese resources, it works.
>
> I am already using the 8.1.005 binaries. However I wanted to
> run the driver in
> debug mode to be able to give a better feedback (stack trace)
> if the driver
> should crash.
>
> BTW, using UseServerSidePrepare is not working. Is this the
> declare/fetch
> issue you are currently tracking? If you need help in testing
> the driver, I
> could check it against my application.

Yes, absolutely. I just committed what I hope will be the last fix for
this (for now at least!). Please try a build from the current CVS code
and let me know how you get on.

Thanks, Dave.

Re: Problem with Chinese characters

From
Mimi Siu
Date:
Hello:

I would like to use ANSI ODBC driver as my sql
statement is already converted to UTF-8 before
calling SQLExecute(). However, i found from the log
file that the client encoding is BIG5 which is my
system's locale, so the text is wrong when it is
inserted to my UNICODE database.

Can I set the client encoding to UTF8 in my DNS or
through any ODBC functions??

Thanks a lot!


--- Dave Page <dpage@vale-housing.co.uk> wrote:

>
>
> > -----Original Message-----
> > From: pgsql-odbc-owner@postgresql.org
> > [mailto:pgsql-odbc-owner@postgresql.org] On Behalf
> Of Mimi Siu
> > Sent: 03 November 2005 10:03
> > To: pgsql-odbc@postgresql.org
> > Subject: [ODBC] Problem with Chinese characters
> >
> > Hi:
> >
> > I am using psqlodbc-08-00-0102 ODBC driver on my
> > Windows 2000 machine and want to insert data (with
> > chinese characters) to the postgresql 8.0.3
> running on
> > RH9.
> >
> > My database is encoded as UNICODE, and my sql
> > statement is already converted to UTF-8 before
> calling
> > SQLExecute(). But I found that the coding of the
> > chinese characters is not UTF-8 in the postgresql
> > database. Also if I insert the record with 10
> chinese
> > characters, the length of the field should be 10,
> but
> > now it is 30.
> >
> > It was previously work when I use the
> > psqlodbc-07-02-01 driver with postgresql 7.3.
>
> Please try the latest snapshot - 08.01.0005. It has
> various fixes and
> can be compiled in Unicode or ANSI/Multibyte mode as
> the older 07.xx
> drivers could (08.00.xxxx was Unicode only).
>
> Regards, Dave
>




__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

Re: Problem with Chinese characters

From
"Dave Page"
Date:

> -----Original Message-----
> From: pgsql-odbc-owner@postgresql.org
> [mailto:pgsql-odbc-owner@postgresql.org] On Behalf Of Mimi Siu
> Sent: 04 November 2005 09:56
> To: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Problem with Chinese characters
>
> Hello:
>
> I would like to use ANSI ODBC driver as my sql
> statement is already converted to UTF-8 before
> calling SQLExecute(). However, i found from the log
> file that the client encoding is BIG5 which is my
> system's locale, so the text is wrong when it is
> inserted to my UNICODE database.
>
> Can I set the client encoding to UTF8 in my DNS or
> through any ODBC functions??

In the connect settings box in the config, you can add something like:

SET client_encoding TO 'UTF8';

Regards, Dave.