OAuth properties cause issues if they include nonascii characters. This change adds a common method to force a string to be UTF-8 and forces all OAuth properties to be UTF-8.
This was discussed in #8003 but the pull request was not completed, here is an updated version.