Couldn't this return `~[char]`? It has all the information necessary and avoids the need to 1) allocate a new `~str` and 2) encode the chars as UTF-8.