Permutations and string compression