Sort with accented characters

This sorts incorrectly. I can understand why, but is there a way to manage this without a lot of extra code?

var s() as string = array("Gé", "Gr")
s.sort

there is a option to give a own sort method as argument and it returns -1,0,1 for each compare
Sort(AddressOf methodName)

i would replaceall characters as example é to e then use < > string for the return value

or use extends and create your own method for arrays
https://documentation.xojo.com/api/language/extends.html

When sorting strings, because a character with a diacritical (é for example) is not a difference in case, they are not grouped with the same character minus the diacritical.

That works. Never noticed the sorting that way before.
Thx.

string have a compare method with locale input, maybe u can use it too.
Compare(other As String, Optional comparison As ComparisonOptions = ComparisonOptions.CaseInsensitive, Optional locale As Locale = Nil) As Integer

FWIW, you should be able to do this by converting the encoding to ASCII.

That’s interesting.
This is for a project I’m working on to manage the process of building an index for a book (my wife’s).
As it turns out there are a bunch of additional considerations when alphabetizing entries so I need a dedicated function to handle it anyway.

I have to believe someone else has built a similar function in Xojo at some point.

I appreciate the feedback. Thank you.