Re: [SQL] Understanding Encoding

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Beena Emerson <memissemerson(at)gmail(dot)com>
Cc: Amit Langote <amitlangote09(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [SQL] Understanding Encoding
Date: 2013-09-06 06:59:29
Message-ID: 14306.1378450769@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

Beena Emerson <memissemerson(at)gmail(dot)com> 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

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tatsuo Ishii 2013-09-06 07:03:12 Re: Understanding Encoding
Previous Message Beena Emerson 2013-09-06 06:47:48 Re: [NOVICE] Understanding Encoding

Browse pgsql-sql by date

  From Date Subject
Next Message Tatsuo Ishii 2013-09-06 07:03:12 Re: Understanding Encoding
Previous Message Beena Emerson 2013-09-06 06:47:48 Re: [NOVICE] Understanding Encoding