Fix UTF-8 support when validating usernames. Fixes #290