Remove trailing whitespace.
Only allowed characters in generated ids.