Re: [NOVICE] Understanding Encoding - Mailing list pgsql-sql

From Tom Lane
Subject Re: [NOVICE] Understanding Encoding
Date
Msg-id 14306.1378450769@sss.pgh.pa.us
Whole thread Raw
In response to Re: [NOVICE] Understanding Encoding  (Beena Emerson <memissemerson@gmail.com>)
Responses Re: [NOVICE] Understanding Encoding  (Beena Emerson <memissemerson@gmail.com>)
List pgsql-sql
Beena Emerson <memissemerson@gmail.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


pgsql-sql by date:

Previous
From: Beena Emerson
Date:
Subject: Re: [NOVICE] Understanding Encoding
Next
From: Tatsuo Ishii
Date:
Subject: Re: Understanding Encoding