Re: UTF-8 and LIKE vs = - Mailing list pgsql-general

From Tatsuo Ishii
Subject Re: UTF-8 and LIKE vs =
Date
Msg-id 20040824.092228.15271660.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: UTF-8 and LIKE vs =  (Ian Barwick <barwick@gmail.com>)
List pgsql-general
> > 
> > В Пнд, 23.08.2004, в 23:04, David Wheeler пишет:
> > > On Aug 23, 2004, at 1:58 PM, Ian Barwick wrote:
> > >
> > > > er, the characters in "name" don't seem to match the characters in the
> > > > query - '국방비' vs. '북한의' - does that have any bearing?
> > >
> > > Yes, it means that = is doing the wrong thing!!
> > 
> > The collation rules of your (and my) locale say that these strings are
> > the same:
> > 
> > [markus@teetnang markus]$ cat > t
> > 국방비
> > 북한의
> > [markus@teetnang markus]$ uniq t
> > 국방비
> > [markus@teetnang markus]$
> 
> wild speculation in need of a Korean speaker, but:
> 
> ian@linux:~/tmp> cat j.txt
> テスト
> 환경설
> 전검색
> 웹문서
> 국방비
> 북한의
> てすと
> ian@linux:~/tmp> uniq  j.txt
> テスト
> 환경설
> てすと
> 
> All but the first and last lines are random Korean (Hangul)
> characters. Evidently our respective locales think all Hangul strings
> of the same length are identical, which is very probably not the
> case...

Locales for multibyte encodings are often broken on many platforms. I
see identical things with Japanese on Red Hat. This is one of the
reason why I tell Japanese PostgreSQL users not to enable locale while
initdb...
--
Tatsuo Ishii

pgsql-general by date:

Previous
From: David Wheeler
Date:
Subject: Re: UTF-8 and LIKE vs =
Next
From: "Marc G. Fournier"
Date:
Subject: Re: Unsupported 3rd-party solutions (Was: Few questions