Thank you for your comprehensive reply. I guess I'm more out of my depth than I thought.
I did discover the uSortStringCompare function, but I couldn't get it to work with my string8 values.
I have also tried stricmp_utf8 with no success (well, I can crash foobar).
I think I should perhaps go back to what I know...
Out of interest, here is the code as it stands:
case IDC_PRESET_SORT:
{
bool bOrdered = false;
unsigned n,m = cfg_presetlist.get_count();
preset_info * pre_now;
string8 pre_now_desc;
string8 pre_nex_desc;
// if there is more than one preset
if(m > 1) {
// loop until all presets have been ordered
while (bOrdered == false) {
bOrdered = true;
// loop through presets
for(n=0;n<m-1;n++) {
// get current preset object (pre_now), and its description (pre_now_desc)
pre_now = new preset_info(cfg_presetlist.get_item(n));
pre_now->get_description(pre_now_desc);
// get next preset's description (pre_nex_desc)
cfg_presetlist.get_item(n+1)->get_description(pre_nex_desc);
console::info(pre_now_desc);
console::info(pre_nex_desc);
// check order
if(stricmp_utf8(pre_nex_desc, pre_now_desc)) {
// remove preset from collection...
cfg_presetlist.delete_item(n);
// ... and (re)add at the end
cfg_presetlist.add_item(pre_now);
// as collection items have shifted up one, shift the counter up too
n--;
// still not ordered...
bOrdered = false;
} // end if
} // next
} // end while
// redraw list
update_preset_list(wnd, false);
} // end if
}
break;