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

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: BUG #3638: UTF8 Character encoding does NOT work


  • From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
  • To: Fil Matthews <fil(at)internetmediapro(dot)com>
  • Cc: pgsql-bugs(at)postgresql(dot)org
  • Subject: Re: BUG #3638: UTF8 Character encoding does NOT work
  • Date: Thu, 27 Sep 2007 08:59:45 +0100
  • Message-id: <46FB62F1.8070906@enterprisedb.com> <text/plain>

Fil Matthews wrote:
> Come on are you serious?? ..  Just how does one work with completly valid
> data that has an ascii 128 +  value ??

A string with a single byte that has high-bit set (characters 128-255)
is *not* a valid UTF-8 sequence. That's why you get the error. One could
argue that chr(146) should throw an error right away, since 146 doesn't
represent a valid ASCII character either.

In fact, this has been changed in the CVS; in the upcoming 8.3 version,
chr(146) in UTF-8 encoding will return a two byte character
corresponding the unicode code point 146, which seems to be a control
character, marked for "private use only".

> Currently this flaw make Postgres an un-useable database technology ..  Or
> can some-one please explain this and a possible work around ..  ??

That's quite an exaggeration, don't you think? As a work around, don't
put invalid data in your database. Don't use chr-function, it's really
only there for compatibility with other DBMSs that has it.

-- 
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group