Date: 21 Apr 2003 12:08:36 -0400 From: Joe Marcus Clarke <marcus@marcuscom.com> To: Tim Robbins <tjr@freebsd.org> Cc: current@freebsd.org Subject: Re: strxfrm() broken? Message-ID: <1050941316.393.9.camel@gyros> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
--=-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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1050941316.393.9.camel>