sorting a string array on Linux

I seem to be having trouble with sorting a string array on Linux. This command

myStringArray.Sort

works fine on Mac OS, but the items are unordered if the code runs on my Ubuntu machine. A locale issue maybe?

Here is the output of the locale command (Ubuntu 14.04)

r# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de_DE.UTF-8
LANGUAGE=
LC_CTYPE=UTF-8
LC_NUMERIC=“de_DE.UTF-8”
LC_TIME=de_DE.UTF-8
LC_COLLATE=“de_DE.UTF-8”
LC_MONETARY=“de_DE.UTF-8”
LC_MESSAGES=“de_DE.UTF-8”
LC_PAPER=“de_DE.UTF-8”
LC_NAME=“de_DE.UTF-8”
LC_ADDRESS=“de_DE.UTF-8”
LC_TELEPHONE=“de_DE.UTF-8”
LC_MEASUREMENT=“de_DE.UTF-8”
LC_IDENTIFICATION=“de_DE.UTF-8”
LC_ALL=

Any known remedies?

Best, Max

Can you post a short example that shows whats not working as expected ?

I am trying to sort folderitems alphabetically in a web app:

dim ct as integer=parentFolderItem.Count //parentFolderItem is a folder containing maybe 20 documents
dim sortedFolderItems() as folderitem
dim sortedFolderItemNames() as string

for i as integer=1 to ct
sortedFolderItems.Append parentFolderItem.Item(i)
sortedFolderItemNames.Append parentFolderItem.Item(i).DisplayName
next

sortedFolderItemNames.Sort
System.DebugLog(join(sortedFolderItemNames,","))

What I see in my output file is this:

Administrative Infos,
Coach-Anleitung,
Tipps_Infos_Hinweise_Extra_Arbeitsbltter
0 Coaching ABLAUF.pdf,
0.0 FAQs fr Coaches.docx,
0.1 Leistungs- u. Terminliste.$
1 Tabelle FachkompetenzVERTRAUICH.pdf,
2 Tabelle Sozialkompetenz_WerteVERTRAUICH
Arbeitsblatt Symbole Genogramm.pdf,
Biographie-Check Alle Hypos.pdf,
2 Beruf Rckblick.pdf,
Checkliste Interview fhren.pdf,
Interview-Erste Sitzung$
01 Musterbewerbung und Fotographen,
Anschreiben - Verfassen und Korrektur.docx

I just tested this code on linux:

dim anArray() as string=Array(“z”,“y”,“x”,“w”,“v”,“u”,“t”)
MsgBox(“before sort:”+join(anArray,","))
anArray.Sort
MsgBox(“after sort:”+join(anArray,","))

and it behaves as expected, so I am not sure what’s going on.

Do the names contain control characters etc that are not visible but sort before ASCII etc ?
I’d examine those names for anything “odd”