The attached patch is intended to ensure that chr() does not produce
invalidly encoded data, as recently discussed on -hackers. For UTF8, we
treat its argument as a Unicode code point; for all other multi-byte
encodings, we raise an error on any argument greater than 127. For all
encodings we raise an error if the argument is 0 (we don't allow null
bytes in text data). The ascii() function is adjusted so that it remains
the inverse of chr() - i.e. for UTF8 it returns the Unicode code point,
and it raises an error for any other multi-byte encoding if the
aregument is outside the ASCII range. I have tested thius inverse
property across the entire Unicode code point range, 0x01 .. 0x1ffff.
TODO: alter docs to reflect changes.
pgsql-patches by date
|Next:||From: Bruce Momjian||Date: 2007-09-14 15:58:05|
|Subject: Re: GSS warnings|
|Previous:||From: Bruce Momjian||Date: 2007-09-14 14:54:26|
|Subject: Re: Linkage for escape strings|