Re: [PATCHES] A Patch for MIC to EUC_TW code converting inmbsupport

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: cch(at)cc(dot)kmu(dot)edu(dot)tw
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] A Patch for MIC to EUC_TW code converting inmbsupport
Date: 2000-11-17 02:28:55
Message-ID: 20001117112855H.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs pgsql-hackers pgsql-patches

> > BTW I would not recommend "SET CLIENT_ENCODING TO 'BIG5'" to do an
> > on-the-fly encoding changes. Since in this way, frontend side has no
> > idea what the client encoding is. 7.0.x overcome this problem by
> > introducing new \encoding command. For 6.5 or before I would recommend
> > to use PGCLIENTENCODING environment variable.
>
> You are right! When I do \encoding BIG5, it works.
> But it seems that "\encoding" can only be issued in
> psql's command prompt or be done with
> PQsetClientEncoding() in libpq.

Yes.

> If our application for input is written in PHP (4.0.2)
> How do we notify PostgreSQL that the frontend encoding
> is 'BIG5' ? (pg_exec("\encoding BIG5") failed.)

I know there are some patches for supporting \encoding in PHP. Do you
want to get them?

> PostgreSQL 7.1 will support automatic code conversion for
> BIG5 to utf-8. Does it means that we do not have to
> announce client encoding as long as the backend is utf-8?

No. You still need to declare that frontend side encoding is BIG5.

> I have also tried to set the environment variable
> PGCLIENTENCODING to 'BIG5'. But when I execute
> psql and then issue \encoding, it shows 'SQL_ASCII' in 7.0.2.
> Is this environment variable useless in 7.0.x and latter?

After checking the souce, I found the capability to recognize the
PGCLIENTENCODING environment variable has been broken since 7.0.
Attached is the patches for 7.0.3. I am going to fix current as well.

Attachment Content-Type Size
libpq.patch text/plain 1.3 KB

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tatsuo Ishii 2000-11-17 02:29:02 Re: Re: [PATCHES] A Patch for MIC to EUC_TW code converting in mbsupport
Previous Message Thomas Lockhart 2000-11-16 16:56:18 Re: confused expression

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2000-11-17 02:29:02 Re: Re: [PATCHES] A Patch for MIC to EUC_TW code converting in mbsupport
Previous Message Marko Kreen 2000-11-17 02:11:10 Re: [rfc] new CREATE FUNCTION (and more)

Browse pgsql-patches by date

  From Date Subject
Next Message Tatsuo Ishii 2000-11-17 02:29:02 Re: Re: [PATCHES] A Patch for MIC to EUC_TW code converting in mbsupport
Previous Message Bruce Momjian 2000-11-16 06:01:30 Re: Re: [PATCHES] A Patch for MIC to EUC_TW code converting in mbsupport