FAQ
Did we make any progress on this? If so, I can't find it.

---------------------------------------------------------------------------

Tom Lane wrote:
"Devrim GUNDUZ" <devrim@gunduz.org> writes:
Just offhand, iwchareq() seems several bricks shy of a load:

/*
* if one of them is an ASCII while the other is not, then they must
* be different characters
*/
else if ((unsigned char) *p1 < CHARMAX || (unsigned char) *p2 < CHARMAX)
return (0);

This test is wrong per Jakub's observation. Also, the code right below
that is using tolower() not towlower() on wide characters, which seems
pretty wrong. For that matter, towlower would be wrong too :-( because
there is no certainty that libc's idea of wide characters is the same as
pg_mb2wchar_with_len's.

So yeah, ILIKE looks just about completely broken for multibyte encodings.
Maybe it would be best to pass both strings through lower() and then
do a normal LIKE comparison?

The regexp code doesn't look better, btw, just differently broken ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org
--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 6 of 33 | next ›
Discussion Overview
grouppgsql-bugs @
categoriespostgresql
postedOct 1, '05 at 3:40p
activeOct 2, '06 at 9:35p
posts33
users8
websitepostgresql.org
irc#postgresql

People

Translate

site design / logo © 2018 Grokbase