Add a shared function testing a string for valid UTF-8.
Add a john.conf option for default input encoding.