[openbeos] Re: [just On Topic, with no flames] Was: Locale Kit

  • From: <kevin.lawton@xxxxxx>
  • To: <openbeos@xxxxxxxxxxxxx>
  • Date: Tue, 23 Dec 2003 12:26:55 -0000

Scott MacMaster opined:   
| It seems to me that a proper sorting system should be independent of any
| character encoding system in order for it to work well with any language.
| By independent, I mean that it doesn't order the characters based on the
| number each character is assigned.  It places words that start with a before
| b because it knows a is because b not because 97 is before 98.  
While the might seem like some ideal worth striving for, it ignores the 
fundamental point that computers are essentially numerical machines. They know 
nothing of 'a' or 'b' - only numbers and how to perform arithmetic and logical 
operations on them. In order for a computer to understand 'a' and 'b' they must 
each first be assigned a numeric value. There are a few different operations a 
computer can use in order to sort numbers into ascending or descending order, 
but the concept of subtraction and then testing the result to be positive or 
negative is typical. The sort could be performed on the numbers used to encode 
the character set, but that is unlikely to yield desirable results. The most 
obvious method is to 'tag' each character with a number which represents its 
position in the desired sort order. To do this takes up some processing time, 
but fortunately modern machines appear to have this in abundance. If the tag 
values assigned were varied according to the sort locale, then this would be 
one method of achieving a locale-dependant sort. 

Other related posts: