NXP-14224: Prevent UnicodeEncodeError mostly by using unicode() instead of str(), only allowing alpha-numeric characters for username and always using 'utf-8' to encode username and password from Settings dialog