X-Original-To: pgsql-sql@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CFF08474E61 for ; Thu, 20 Feb 2003 05:55:47 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 44226-01 for ; Thu, 20 Feb 2003 05:55:37 -0500 (EST) Received: from gyw.com (gyw.com [209.55.67.177]) by postgresql.org (Postfix) with ESMTP id BA3CF4758FE for ; Thu, 20 Feb 2003 05:55:11 -0500 (EST) Received: from spi.tksoft.com (smtp3.tksoft.com [192.168.50.56] (may be forged)) by gyw.com (8.8.8/8.8.8) with ESMTP id CAA30066 for ; Thu, 20 Feb 2003 02:59:24 -0800 Received: from tksoft.com (tksoft.com [127.0.0.1]) by spi.tksoft.com (8.12.4/8.12.4) with ESMTP id h1KApTQC018185; Thu, 20 Feb 2003 02:51:29 -0800 Received: (from tjk@tksoft.com) by tksoft.com (8.12.4/8.12.4/Submit) id h1KApSSN018184; Thu, 20 Feb 2003 02:51:28 -0800 Message-Id: <200302201051.h1KApSSN018184@tksoft.com> Subject: Re: once again, sorting with Unicode To: antti.haapala@iki.fi (Antti Haapala) Date: Thu, 20 Feb 2003 02:51:28 -0800 (PST) Cc: tjk@tksoft.com (Troy K.), postgre@totw.org (JBJ), pgsql-sql@postgresql.org Reply-To: tjk@tksoft.com (Troy K.), In-Reply-To: from "Antti Haapala" at Feb 19, 2003 02:37:27 PM From: "Troy" X-Info: None MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/453 X-Sequence-Number: 11851 You are right, of course. I was thinking in terms of the encoded data. Applications usually get data in UTF8 or UTF16. If the input data is true unicode, then there is no difference in the byte values (just skip the 0x00 bytes). Cheers, Troy > > > On Wed, 19 Feb 2003, Troy wrote: > > > > I have a multi-lingual database (currently 11 languages) which sorts > > > fine in MySQL (8859-1 character set) I have now converted the data to > > > Unicode and compiled Postgre with unicode support. > > > > > > I can select and insert unicode and so was rather pleased about that. > > > Until I saw that it wasn't working properly when ordering! > > > > The cause for the different values is the fact that unicode characters > > have different numeric values from ISO8859-1 and other encodings. Only > > ascii values are in sync with unicode numeric values. This I am sure you > > knew. > > No, ISO8859-1 maps directly to unicode up to U+00FF. So the actual > _numeric_ values are the same. But actual byte patterns are encoding > dependent. > > Have you set database encoding to UTF-8? Are you using proper UTF-8 > locales? POSIX compiled locales are often charset dependent. > > -- > Antti Haapala > > > >