Re: About PQsetClientEncoding(),"SET NAMES",and "SETCLIENT_ENCODING"

From: Kevin Lo <kevin(dot)lo(at)toptk(dot)com>
To: Chih-Chang Hsieh <cch(at)cc(dot)kmu(dot)edu(dot)tw>
Cc: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: About PQsetClientEncoding(),"SET NAMES",and "SETCLIENT_ENCODING"
Date: 2000-12-27 20:16:36
Message-ID: 3A4A4E24.66E1F930@toptk.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

C.C. Hsieh wrote:

> Tatsuo Ishii wrote:
>
> > Here are the patches I promised against PHP
> > 3.0.15 or later.
> >
> > To set the client encoding to BIG5:
> >
> > pg_setclientencoding($cid, "BIG5");
> >
> > ($cid is the connection id)
> >
> > To get the current client encoding:
> >
> > pg_clientencoding($cid);
> >
> > Note that these fucntions are already included in the latest PHP4.
>
> Thank you!
> Your README.mb has been translate into Chinese (Big5 encoding) in the
> attachement.
> Would someone like to review it?

Reviewed. No problem :-)
Would anyone commit it? Thanks.

> After translating it, I still have one question: (Sorry, I have not read the
> source code.)
> What is the difference among "libpq -- PQsetClientEncoding()",
> "SQL command -- SET NAMES", and
> "SQL command -- SET CLIENT_ENCODING"?
> For example: If we use PHP (>4.0.2), which way is correct or mostly correct?
>
> 1. pg_setclientencoding($cid, "BIG5")
> 2. pg_exec("SET NAMES 'BIG5'")
> 3. pg_exec("SET CLIENT_ENCODING TO 'BIG5'")
>
> --
> Chih-Chang Hsieh

- Kevin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Adam Lang 2000-12-27 21:30:46 Re: PHP and PostgreSQL
Previous Message Tom Lane 2000-12-27 18:47:14 Re: configure in snapshout == configure.in