Re: Multibyte characters over the frontend/backend

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Bruce Badger <bruce_badger(at)BadgerSE(dot)com>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: Multibyte characters over the frontend/backend
Date: 2002-12-05 00:00:58
Message-ID: Pine.LNX.4.44.0212050009460.12428-100000@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Bruce Badger writes:

> Now, here's where I don't know what to do. I want to insert into the
> new table using something like:
> "insert into test values ("xyz");"
> ... but where "xyz" is really the KOI8 charaters 0x0422 0x0423 and 0x0416

(I assume those are the equivalent Unicode codepoints. KOI8 is a
single-byte encoding.)

> The question is, what bytes should be sent in the String data type of
> the Query message I send to the back end?

Whatever the string looks like when encoded using KOI8. There is no magic
here.

> If I make the whole string multi-byte, I get a sytax error at or near "i".

That means you're probably not sending KOI8. Also be sure to set the
client encoding to KOI8 as well. (Unfortunately, this aspect is not
documented in the protocol documentation. Check how libpq handles the
PGCLIENTENCODING environment variable.)

--
Peter Eisentraut peter_e(at)gmx(dot)net

In response to

Browse pgsql-interfaces by date

  From Date Subject
Next Message David Wheeler 2002-12-05 17:39:27 Re: DBD::Pg 1.20 uncompatible with Postgres 7.3?
Previous Message Bruce Badger 2002-12-04 01:54:29 Multibyte characters over the frontend/backend protocol