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: 2007-09-27 07:59:45
Message-ID: 46FB62F1.8070906@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Gregory Stark 2007-09-27 08:46:26 Re: BUG #3638: UTF8 Character encoding does NOT work
Previous Message Tatsuo Ishii 2007-09-27 07:57:38 Re: BUG #3638: UTF8 Character encoding does NOT work