Skip site navigation (1) Skip section navigation (2)

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

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: About PQsetClientEncoding(),"SET NAMES",and "SET CLIENT_ENCODING"
Date: 2000-12-27 23:36:41
Message-ID: 20001228083641E.t-ishii@sra.co.jp (view raw or flat)
Thread:
Lists: pgsql-docspgsql-hackerspgsql-patches
> 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'")

2 and 3 are actually identical: telling the backend "Your client's
encoding is BIG5, so you need to convert EUC_TW to BIG5 before sending
data to the client. Also you need to convert BIG5 to EUC_TW when
receiving data from him."

1 is doing the same thing as 2 or 3 AND set the internal encoding of
libpq, which is linked to PHP, to BIG5. This is neccesary in case of
the second byte of BIG5 character is "\" or one of other control
characters.
--
Tatsuo Ishii

In response to

pgsql-docs by date

Next:From: Gilles BernardDate: 2000-12-29 08:43:31
Subject: Postgres ignoring RTree for geometric operators
Previous:From: Michael GraffDate: 2000-12-27 16:09:27
Subject: Rather incorrect text in admin guide

pgsql-hackers by date

Next:From: Tom LaneDate: 2000-12-27 23:44:42
Subject: Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)
Previous:From: Brent VernerDate: 2000-12-27 23:35:30
Subject: Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)

pgsql-patches by date

Next:From: Tom LaneDate: 2000-12-27 23:44:42
Subject: Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)
Previous:From: Brent VernerDate: 2000-12-27 23:35:30
Subject: Re: [HACKERS] Re: Tuple-valued datums on Alpha (was Re: 7.1 on DEC/Alpha)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group