Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VHq10-00084P-PZ for pgsql-novice@arkaria.postgresql.org; Fri, 06 Sep 2013 06:59:34 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VHq10-0007K6-1Q for pgsql-novice@arkaria.postgresql.org; Fri, 06 Sep 2013 06:59:34 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VHq0y-0007JA-UK; Fri, 06 Sep 2013 06:59:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VHq0w-0003fU-L5; Fri, 06 Sep 2013 06:59:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id r866xT0O014307; Fri, 6 Sep 2013 02:59:29 -0400 From: Tom Lane To: Beena Emerson cc: Amit Langote , pgsql-sql@postgresql.org, "pgsql-novice@postgresql.org" Subject: Re: [SQL] Understanding Encoding In-reply-to: References: Comments: In-reply-to Beena Emerson message dated "Fri, 06 Sep 2013 12:17:48 +0530" Date: Fri, 06 Sep 2013 02:59:29 -0400 Message-ID: <14306.1378450769@sss.pgh.pa.us> X-Pg-Spam-Score: -4.3 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-novice Precedence: bulk Sender: pgsql-novice-owner@postgresql.org Beena Emerson writes: > It still gives same result: > $ LANG=ko_KR LC_ALL=ko_KR > $ psql -d korean > korean=# SHOW client_encoding; > client_encoding > ----------------- > EUC_KR > (1 row) > korean=# INSERT INTO tbl VALUES ('그레스'); > ERROR: invalid byte sequence for encoding "EUC_KR": 0xa0 0x88 What you need to figure out is what encoding the text you are typing is in. You're telling psql it's EUC_KR but it evidently isn't. If you're typing these characters manually then it's probably determined by a setting of the terminal-emulator program you're using. But if you're copying-and-pasting then things get more complicated. Also, what you did above is not what Amit suggested: he wanted you to put the variable assignments on the same command line as the psql invocation, so that they'd affect the environment passed to psql. I'm suspicious of his solution because I'd have thought the terminal program would set up the right environment ... but you might as well try it. regards, tom lane -- Sent via pgsql-novice mailing list (pgsql-novice@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-novice