CharacterFunctions - collate


#1

Hi Jules,

I was playing with the code trying to make my table sort strings according to our national alphabet… Functions in String class seem to be using CharacterFunctions class which in turn uses strcmp() functions for string comparison. Would that be possible to change that to strcoll() functions instead, so that users (like me) can setlocale() to his own and still take advantage of the String class? (say in our Alphabet comes the ‘ch’ character after ‘h’, not the ‘c’ as would in standard English collate, and strcoll() can deal with that easily)

Or if that might cause some problems (I didn’t test it properly) make some new function like String::compareUsingCollate(String s, Collate col=defalutLocalCollate) or something like that?

Thank you.

Y.


#2

hi there

Yes, that’s a good question. Probably not a good idea for me to change the way the existing methods work, as that’s likely to break people’s code, but adding some stuff to do this is a good idea.


#3