Welcome to the Invelos forums. Please read the forum rules before posting.

Read access to our public forums is open to everyone. To post messages, a free registration is required.

If you have an Invelos account, sign in to post.

    Invelos Forums->DVD Profiler: Desktop Technical Support Page: 1  Previous   Next
:-[ Special characters, sorting in Titles
Author Message
DVD Profiler Unlimited RegistrantWhite Pongo, Jr.
No, I iz no Cheshire Cat!
Registered: August 22, 2007
Reputation: High Rating
Posts: 1,807
Posted:
PM this userDirect link to this postReply with quote
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
DVD Profiler Unlimited RegistrantStar Contributorsnarbo
Registered: March 13, 2007
United Kingdom Posts: 1,242
Posted:
PM this userDirect link to this postReply with 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
DVD Profiler Unlimited RegistrantWhite Pongo, Jr.
No, I iz no Cheshire Cat!
Registered: August 22, 2007
Reputation: High Rating
Posts: 1,807
Posted:
PM this userDirect link to this postReply with quote
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
DVD Profiler Unlimited RegistrantStar Contributorsnarbo
Registered: March 13, 2007
United Kingdom Posts: 1,242
Posted:
PM this userDirect link to this postReply with 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
 Last edited: by snarbo
DVD Profiler Unlimited RegistrantWhite Pongo, Jr.
No, I iz no Cheshire Cat!
Registered: August 22, 2007
Reputation: High Rating
Posts: 1,807
Posted:
PM this userDirect link to this postReply with quote
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
DVD Profiler Unlimited RegistrantStar Contributorsnarbo
Registered: March 13, 2007
United Kingdom Posts: 1,242
Posted:
PM this userDirect link to this postReply with quote
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
DVD Profiler Desktop and Mobile RegistrantStar ContributorDJ Doena
Registered: May 1, 2002
Registered: March 14, 2007
Reputation: Highest Rating
Germany Posts: 6,744
Posted:
PM this userEmail this userVisit this user's homepageView this user's DVD collectionDirect link to this postReply with quote
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
DVD Profiler Desktop and Mobile RegistrantDr. Killpatient
Here's my card
Registered: May 19, 2007
Reputation: Highest Rating
United States Posts: 5,917
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
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.
DVD Profiler Desktop and Mobile Registrantlmoelleb
Beer Profiler now!
Registered: March 14, 2007
Denmark Posts: 630
Posted:
PM this userView this user's DVD collectionDirect link to this postReply with quote
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
    Invelos Forums->DVD Profiler: Desktop Technical Support Page: 1  Previous   Next