From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: strcoll() Date: Sun, 28 Dec 1997 20:50:56 +0100 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 65 Message-ID: <34A6ADA0.63F9365E@LSTM.Ruhr-UNI-Bochum.De> References: <34A5788C DOT 4DAF AT cs DOT com> NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit Precedence: bulk John M. Aldrich wrote: > > Gili wrote: > > > > I read the description for strcoll() and it isn't clear at all. Could > > you please: > > > > 1) Modify the help in order to explain this command in more detail > > 2) Explain it to me > > > > I refered to the word collate in the dictionary but it still does not > > aid me in understand the purpose of this function. Please provide me > > with some example source code. Yours truly, > > My guess is that it provides an alternative to strcmp(), using a > collating sequence native to the computer in question instead of the > standard ASCII collating sequence. I looked at the source code for the > DJGPP version; all strcoll() does is call strcmp(). > > I don't imagine that strcoll() would be useful in any but the most > exotic of circumstances, and in those rare cases, the person using it > ought to know what those circumstances are. :-) Well, strcmp() is in fact under most circumstances plain dead wrong, and if you are interested in printing out, e.g. database records sorted alphabetically by some key, strcmp() will give correct results only for a small minority of people on this earth (some 3% or so). Nothing I would call exactly ``exotic'' or ``rare''. The only thing that is rare are programms supporting correct sorting. In german, e.g., the Umlauts (funny chars with dots like <ä>, you will probably see junk here) are sorted like ae, oe, ue, <ß> is sorted like ss. Diacritical characters (the "french" vowels and what you have in "niNa super turtles" over the n are sorted like normal characters. French, italian, spanish, dutch and whatever language that uses ``similar'' characters probably widely differ. Not to mention languages that use cyrillic, chinese, japanese or whatever type of characters. -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************