Re: encoding question

From: Ivo Rossacher <rossacher(at)bluewin(dot)ch>
To: pgsql-admin(at)postgresql(dot)org
Cc: "Ben K(dot)" <bkim(at)coe(dot)tamu(dot)edu>
Subject: Re: encoding question
Date: 2006-03-20 23:21:42
Message-ID: 200603210021.42784.rossacher@bluewin.ch
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Am Montag, 20. März 2006 23.56 schrieb Ben K.:
> Hi,
>
> My main server is on Solaris (LANG=C), postgresql 8.1.0, with encoding
> SQL_ASCII.

SQL_ASCII is not an encoding. It marks that there is no encoding and therefore
no check of the stored byte codes. This means that the client is fully
responsible for the correctness of the byte codes. If the client does no
checks on the byte codes it is possible for the user to enter non ascii
characters which will create trubles when sent to the unicode server.

You can find several different solutions for this kind of issues in the
archives. Which to use depends on the details of your problem.

Best Regards
Ivo

>
> I'm trying to set up a backup server on linux (LANG=en_US.UTF-8), with
> encoding UTF8.
>
> I thought UTF8 was safe if all I have is ascii, since there was a relevant
> discussion in this list a short while ago, but I'm getting this error, for
> a few records (out of tens of thousands in that database).
>
> ===============
> ERROR: invalid UTF-8 byte sequence detected near byte 0x85
> CONTEXT: COPY tblcoursesinfo, line 30, column title: "Seminar in<85>
> ..."
> ===============
>
> The dump was created by 8.1.0's pg_dump with no options.
>
> That line in the dump has the following contents.
>
> Text:
>
> n<85> Knowledg
>
> Binary:
>
> 02e2100: 6e85 2020 2020 2020 2020 2020 2020 2020 n.
> 02e2110: 2020 2020 2020 2020 2020 2020 2020 2020
> 02e2120: 2020 2020 2020 2020 2020 2020 2020 2020
> 02e2130: 2020 2020 2020 2020 2020 2020 2020 2020
> 02e2140: 2020 2020 2020 2020 2020 2020 2020 2020
> 02e2150: 2020 2020 2020 2020 2020 2020 2020 2020
> 02e2160: 2020 2020 2020 2020 2020 2020 2020 2020
> 02e2170: 2020 2020 2020 2009 4b6e 6f77 6c65 6467 .Knowledg
>
> Where could this be coming from? Would appreciate help.
>
>
> Regards,
>
> Ben K.
> Developer
> http://benix.tamu.edu
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2006-03-20 23:41:50 Re: encoding question
Previous Message Ben K. 2006-03-20 22:56:57 encoding question