Re: [SQL] Understanding Encoding

From: Beena Emerson <memissemerson(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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 07:24:27
Message-ID: CAOG9ApG=wAXN-gvbTQOnMFwnM5ASaG7dLy5UcpSmpHLq1TQH8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice pgsql-sql

On Fri, Sep 6, 2013 at 12:29 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> 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.
>

I tried with both the assignment and invocation in same line. Again it gave
the same result.
Maybe the problem is with copy paste. I will look into it.
Thank you.

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Sebastien FLAESCH 2013-09-06 07:53:38 Re: Understanding Encoding
Previous Message Amit Langote 2013-09-06 07:14:18 Re: [NOVICE] Understanding Encoding

Browse pgsql-sql by date

  From Date Subject
Next Message Sebastien FLAESCH 2013-09-06 07:53:38 Re: Understanding Encoding
Previous Message Amit Langote 2013-09-06 07:14:18 Re: [NOVICE] Understanding Encoding