Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eAL5lns70748 for ; Tue, 21 Nov 2000 00:47:49 -0500 (EST) (envelope-from pgsql-hackers-owner@postgresql.org) Received: from cc.kmu.edu.tw (cc.kmu.edu.tw [163.15.154.1]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAF1Des74982 for ; Tue, 14 Nov 2000 20:13:43 -0500 (EST) (envelope-from cch@cc.kmu.edu.tw) Received: from cc.kmu.edu.tw (c198.cc.kmu.edu.tw [163.15.154.198]) by cc.kmu.edu.tw (8.9.3/8.9.3) with ESMTP id JAA10218; Wed, 15 Nov 2000 09:09:38 +0800 Message-ID: <3A11E40A.47E528D@cc.kmu.edu.tw> Date: Wed, 15 Nov 2000 09:16:58 +0800 From: Chih-Chang Hsieh Reply-To: cch@cc.kmu.edu.tw Organization: KMU Computer Center X-Mailer: Mozilla 4.73 [zh_TW] (X11; I; FreeBSD 4.1.1-STABLE i386) X-Accept-Language: en MIME-Version: 1.0 To: Tatsuo Ishii CC: pgsql-hackers@postgresql.org Subject: Re: [PATCHES] A Patch for MIC to EUC_TW code converting inmbsupport References: <3A0A07FA.129ED448@cc.kmu.edu.tw> <20001109134325L.t-ishii@sra.co.jp> <3A0FCEFA.42F0BABF@cc.kmu.edu.tw> <20001114145434O.t-ishii@sra.co.jp> Content-Type: text/plain; charset=big5 Content-Transfer-Encoding: 8bit X-Archive-Number: 200011/919 X-Sequence-Number: 1013 Tatsuo Ishii ¼g¹D¡G > > For example: If we initdb -E MULE_INTERNAL first, > > SET CLIENT_ENCODING TO 'BIG5', and > > INSERT INTO some_table VALUES (..., 'the last byte of some Big5 char is > > backslash\',...), > > then we can not successfully complete this SQL INSERT -- the prompt of psql > > changes > > Hum. initdb -E MULE_INTERNAL should work as well. Let me dig into the > problem. It would be nice if you could send me the Big5 data for > testing by a private mail. > 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. 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.) 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? 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? Thank you so much for a newbie! -- Chih-Chang Hsieh