Remove duplicates in a string containing ascii characters