From owner-freebsd-current@FreeBSD.ORG Mon Apr 21 09:08:49 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8B52437B401; Mon, 21 Apr 2003 09:08:49 -0700 (PDT) Received: from ms-smtp-01.southeast.rr.com (ms-smtp-01.southeast.rr.com [24.93.67.82]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B3F143FBF; Mon, 21 Apr 2003 09:08:48 -0700 (PDT) (envelope-from marcus@marcuscom.com) Received: from mail3.nc.rr.com (fe3 [24.93.67.50])h3LG4EhC008434; Mon, 21 Apr 2003 12:04:14 -0400 (EDT) Received: from creme-brulee.marcuscom.com ([66.57.17.158]) by mail3.nc.rr.com with Microsoft SMTPSVC(5.5.1877.757.75); Mon, 21 Apr 2003 12:06:07 -0400 Received: from [10.2.1.4] (vpn-client-4.marcuscom.com [10.2.1.4]) h3LG6qaa044899; Mon, 21 Apr 2003 12:06:52 -0400 (EDT) (envelope-from marcus@marcuscom.com) From: Joe Marcus Clarke To: Tim Robbins In-Reply-To: <20030421175347.B41423@dilbert.robbins.dropbear.id.au> References: <1050907939.9550.68.camel@shumai.marcuscom.com> <20030421175347.B41423@dilbert.robbins.dropbear.id.au> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-VY3LQQkVGzteVDSgF4Eh" Organization: MarcusCom, Inc. Message-Id: <1050941316.393.9.camel@gyros> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 21 Apr 2003 12:08:36 -0400 X-Spam-Status: No, hits=-38.6 required=5.0 tests=BAYES_10,EMAIL_ATTRIBUTION,IN_REP_TO,PGP_SIGNATURE_2, QUOTED_EMAIL_TEXT,QUOTE_TWICE_1,REFERENCES, REPLY_WITH_QUOTES autolearn=ham version=2.50 X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) cc: current@freebsd.org Subject: Re: strxfrm() broken? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Apr 2003 16:08:49 -0000 --=-VY3LQQkVGzteVDSgF4Eh Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Mon, 2003-04-21 at 03:53, Tim Robbins wrote: > On Mon, Apr 21, 2003 at 02:52:20AM -0400, Joe Marcus Clarke wrote: >=20 > > I'm posting this to current@ as that's where I first discovered the > > problem. However, -STABLE seems to be affected as well. The attached > > example code demonstrates the problem pretty well. It seems that when > > LANG, LC_ALL, or LC_COLLATE is set to anything other than C or POSIX > > (e.g. en_US.ISO8859-1), strxfrm() returns garbage. I think I'm using i= t > > correctly (actually glib is the one that pointed me this way). Is ther= e > > anything wrong in the attached code, or is strxfrm() truly broken?=20 > > Thanks. >=20 > What do you think is wrong with the output? What strxfrm() essentially do= es on > FreeBSD is to convert each input character into its primary collation wei= ght. > In the "C" locale, each character's collation weight is the same as its > character code, as the second result from your program shows. In other > locales, there is not necessarily any such correspondence between charact= er > codes and collation weights. You should only really be comparing the resu= lt > of strxfrm() on different strings (with strcmp() etc.). Thanks for the response. It never fails that after you send an email, you find information that shows you have no idea what you're talking about. I was mistaken, and found that I was mislead by how the app in question was using the collation key. In any event, the bug is fixed where it should be fixed, and I feel like a moron. Sorry for the noise. Joe >=20 >=20 > Tim --=20 PGP Key : http://www.marcuscom.com/pgp.asc --=-VY3LQQkVGzteVDSgF4Eh Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQA+pBeEb2iPiv4Uz4cRAlDjAJ9xiJ8RgmYy+X2x1qy73f1C2sGWRgCgrz/c C2G9xOuTjBVB1JIdL2IA4DI= =0Lv2 -----END PGP SIGNATURE----- --=-VY3LQQkVGzteVDSgF4Eh--