> 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
- [HACKERS] Re: [PATCHES] A Patch for MIC to EUC_TW code co... Tatsuo Ishii
- Re: [HACKERS] Re: [PATCHES] A Patch for MIC to EUC_T... Bruce Momjian
- Re: [HACKERS] Re: [PATCHES] A Patch for MIC to E... Tatsuo Ishii
- [HACKERS] Re: [PATCHES] A Patch for MIC to EUC_TW co... Chih-Chang Hsieh
- [HACKERS] Re: [PATCHES] A Patch for MIC to EUC_T... Tatsuo Ishii
- Re: [HACKERS] Re: [PATCHES] A Patch for MIC ... Tatsuo Ishii
- [HACKERS] About PQsetClientEncoding(),&q... Chih-Chang Hsieh
- Re: [HACKERS] About PQsetClientEnco... Tatsuo Ishii
- Re: [HACKERS] About PQsetClientEnco... Bruce Momjian
- Re: [HACKERS] About PQsetClient... Tatsuo Ishii
- Re: [HACKERS] About PQsetCl... Chih-Chang Hsieh