Author |
Message |
Registered: August 22, 2007 | Reputation: | Posts: 1,807 |
| Posted: | | | | It seems to me that
"_" and "[" are sorted after "Z",
":" is sorted before "A" but after any number,
"-" and "(" are sorted before all numbers and letters.
The same applies to the Sort Title field.
Wouldn't a "all special chars before any letter or number" sorting be more intuitive? | | | -- Enry |
|
Registered: March 13, 2007 | Posts: 1,242 |
| Posted: | | | | I can't be certain of this Enry...But I think you'll find that the sort sequence for the special characters is based upon the ascii code sorting.
Try running "Character Map" Window XP machine Start>All Programs>Accessories>System Tools>Character Map
and scroll down through you will see that the sequence you are refering too links to the sequence in Character Map thus the ascii coding for much of the alphabet.
Steve |
|
Registered: August 22, 2007 | Reputation: | Posts: 1,807 |
| Posted: | | | | Quoting snarbo: Quote: I can't be certain of this Enry...But I think you'll find that the sort sequence for the special characters is based upon the ascii code sorting.
Try running "Character Map" Window XP machine Start>All Programs>Accessories>System Tools>Character Map
and scroll down through you will see that the sequence you are refering too links to the sequence in Character Map thus the ascii coding for much of the alphabet.
Steve You are right. Actually it's the sequence in Character Map. | | | -- Enry |
|
Registered: March 13, 2007 | Posts: 1,242 |
| Posted: | | | | As a further aid Ascii TableThe table as listed with the extended table shown below Hope this throws some more light on the sequence. Steve Found a site with the full 256 codes Hereedit by steve Dec 22 6:23 UK time | | | Last edited: by snarbo |
|
Registered: August 22, 2007 | Reputation: | Posts: 1,807 |
| Posted: | | | | Quoting snarbo: Quote: As a further aid
Ascii Table
The table as listed with the extended table shown below
Hope this throws some more light on the sequence.
Steve Found a site with the full 256 codes
Here
edit by steve Dec 22 6:23 UK time Thanks. But wouldn't it be possible/advisable to override that sequence and leave all the special chars before numbers and letters? What do the editorial practices suggest for character sorting? | | | -- Enry |
|
Registered: March 13, 2007 | Posts: 1,242 |
| Posted: | | | | Best take that up with Ken...but if as I suspect the sorting is done on the ascii code that would mean the whole of te computing world will have to change so that you can have the special characters sorted first. Anybody feel like changing the world as we know it? Steve |
|
Registered: March 14, 2007 | Reputation: | Posts: 6,745 |
| Posted: | | | | In the .NET programming environment I found several possibilities to sort string, but that is only in regard of how to handle numbers and special chars like ä, â, ã and so on, but nothing in regard to other special chars. I don't think it'll be that different in Delphi. | | | Karsten DVD Collectors Online
| | | Last edited: by DJ Doena |
|
Registered: May 19, 2007 | Reputation: | Posts: 5,917 |
| Posted: | | | | I suspect the sort results are ordered based on a query result. If that's the case, the only real hope is if the database engine can support different sorting methods. I had typed up a long explanation of how complicated to do manually in the program but ended up deleting it because the explanation got too complicated as well. |
|
Registered: March 14, 2007 | Posts: 630 |
| Posted: | | | | If a program is done in a modern environment sorting is more or less handled automatically. In .NET the "Sort" method will do the right thing without having to use the Comparison stuff Karsten found (Sort will end up calling these methods obviously, but there is no need to waste time calling them manually). I am not 100% sure how it handles the special characters either, but I do not care - DVD Profiler has to accept the standard way the environment deals with them - sorting is about predictability and DVD Profiler is just one program out of millions. If every program had it's own rules for sorting it would be a nightmare.
With obsolete environments like Delphi the best guess is probably just calling the operating system's API if the environment can't do the right thing by default - it should be fairly simply but I do not know Delphi so I can't say exactly how it is done.
If the database can't do the correct sorting then the solution is simple - sort the data after it is retreived. The only place there MIGHT be a performance issue with this approach is in long lists like the actors list. The actual DVD list would not give any problems on this side of a few hundred thousand entries.
So yes, the fix is trivial - even in Delphi.
PS: Be careful taking about the "extended" or "full 256" list. Anything in the 128-255 range is variable when it comes to ANSI (ASCII only covers 0-127). A simple change on the regional settings in the control panel will change the meaning of these bytes - which is obviously why no modern program relies on ANSI anymore. | | | Regards Lars | | | Last edited: by lmoelleb |
|