Skip site navigation (1) Skip section navigation (2)

Re: inserting non-ascii characters

From: Andreas Seltenreich <andreas+pg(at)gate450(dot)dyndns(dot)org>
To: "Peter Schonefeld" <peter(dot)schonefeld(at)bigpond(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: inserting non-ascii characters
Date: 2005-09-10 04:29:02
Message-ID: 878xy5zgtt.fsf@gate450.dyndns.org (view raw or flat)
Thread:
Lists: pgsql-novice
Peter Schonefeld schrob:

> I'm having trouble finding out how to add non-ascii chars into the database
> from c#. 'ERROR: 22021: invalid byte sequence for encoding "UNICODE": 0xfc '
> is the error I get when attempting to add something like "müller" into a
> varchar field from my program.

I guess your client_encoding does not match the encoding of your data.
If the 0xfc is the "ü" in "müller", then your data is probably encoded
as latin-1 / iso-8859-1.

   set client_encoding to 'iso-8859-1';

before your statements should set up proper conversion.

HTH
Andreas
-- 

In response to

Responses

pgsql-novice by date

Next:From: Chris BrowneDate: 2005-09-10 05:40:08
Subject: Re: Database Migration
Previous:From: Peter SchonefeldDate: 2005-09-10 03:30:26
Subject: inserting non-ascii characters

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group