delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/12/28/15:01:39

From: Thomas Demmer <demmer AT LSTM DOT Ruhr-UNI-Bochum DOT De>
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: <bWLoegW7sFse-pn2-GFp6hshdXtXk AT portD08 DOT Generation DOT NET> <34A5788C DOT 4DAF AT cs DOT com>
NNTP-Posting-Host: bvb.lstm.ruhr-uni-bochum.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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, <&szlig;> 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                *
*************************************************************

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019