What I meant to avoid is to wait to discover these characters.
Understood now. Not wanted to be/sound clever.
(btw last showed code contains a flaw but that is for TS to figure out
)
I have a feeling that TomTom is targeting Windows. If so then use Windows function:
Yes, i've tried that before i posted my adjusted naturalsort but could not get it to work (as requested by TS) for this data:
C:\35\123\0\0\1\dummy.filename
C:\35\123\0\0\1.1\dummy.filename
C:\35\123\0\0\1.2\dummy.filename
C:\35\123\0\0\1.3\dummy.filename
C:\35\123\0\0\2\dummy.filename
C:\35\123\0\0\2.1\dummy.filename
C:\35\123\0\0\2.2\dummy.filename
C:\35\123\0\0\2.3\dummy.filename
C:\35\123\0\0\3.1\dummy.filename
C:\35\123\0\0\9\dummy.filename
C:\35\123\0\0\4.3\dummy.filename
With StrCmpLogicalW it sort for me as:
C:\35\123\0\0\1.1\dummy.filename
C:\35\123\0\0\1.2\dummy.filename
C:\35\123\0\0\1.3\dummy.filename
C:\35\123\0\0\1\dummy.filename
C:\35\123\0\0\2.1\dummy.filename
C:\35\123\0\0\2.2\dummy.filename
C:\35\123\0\0\2.3\dummy.filename
C:\35\123\0\0\2\dummy.filename
C:\35\123\0\0\3.1\dummy.filename
C:\35\123\0\0\4.3\dummy.filename
C:\35\123\0\0\9\dummy.filename
It seems that StrCmpLogicalW uses the same approach for sorting/comparing as the natural comparison function from Martin.
Therefor imho: only because each entry in explorer is an individual standalone 'part' of the complete folder/path it works. Shell-api seems to use (or allow to use) some other approaches but i have a hunch they fall back to a similar function like StrCmpLogicalW
Thanks for the casts and conversion though as i always seem to do that wrong
edit: typo's