sed foo -e 's/ /\n/g' | sort | uniq
By the time you say “unicode” and “collation” the programmer is going to be in serious trouble.
Fortunately the programmer can lawyer the problem. The original requirements don’t specify what the strings are sorted by. I choose “position in original source” file and complete the task with a NOP.
tr ' ' '\n' < foo | sort | uniq