You should typically uses a localized sort when displaying data to the user.
Normally in a sort, capitalization don't matters except when a string only differ in capitalisation.
I would think that in most language capital letter come first.
Thus, the typically sorted output should be:
AA
aa
Ab
bb
C++ has locale for that... but I never used them. I was generally using Windows sort functions
lstrcmp Function (Win32 API)[
^]
When the sorting is used for display purpose, sort should typically be done according to text language (or OS language). When sort is only used internally, default sort might be appropriate.