My apologies for not reading the code properly.

Attached patch using pg_utf_mblen() instead of an indexed table.
It now also do bounds checks.


John Hansen

-----Original Message-----
From: Tom Lane [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 07, 2004 4:37 AM
To: John Hansen
Cc: Hackers; Patches
Subject: Re: [HACKERS] UNICODE characters above 0x10000 

"John Hansen" <[EMAIL PROTECTED]> writes:
> Attached, as promised, small patch removing the limitation, adding 
> correct utf8 validation.

Surely this is badly broken --- it will happily access data outside the
bounds of the given string.  Also, doesn't pg_mblen already know the
length rules for UTF8?  Why are you duplicating that knowledge?

                        regards, tom lane

Attachment: wchar.c.patch
Description: wchar.c.patch

---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Reply via email to