Re: Fixed length data types issue

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Gregory Stark <stark(at)enterprisedb(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fixed length data types issue
Date: 2006-09-15 09:01:19
Message-ID: 450A6BDF.3050503@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Gregory Stark wrote:
> It's limited but I wouldn't say it's very limiting. In the cases where it
> doesn't apply there's no way out anyways. A UTF8 field will need a length
> header in some form.

Actually, you can determine the length of a UTF-8 encoded character by
looking at the most significant bits of the first byte. So we could
store a UTF-8 encoded CHAR(1) field without any additional length header.

See http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 for the bit patterns.

AFAIK, UTF-16 works similarly.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-09-15 09:32:21 Re: New version of money type
Previous Message Magnus Hagander 2006-09-15 08:59:03 Re: Build v8.1.4 with VC++ 2005