SSO redirect fails for non latin chars

@gerald is right, the plugin does not deal properly with URL and Unicode characters. I’m helping him on this matter.

After investigating, it seems you need to encode properly the URL before sending the request: wp-discourse/lib/sso-client/query-redirect.php at main · discourse/wp-discourse · GitHub
Possible and working suggestion: utf8_uri_encode($redirect_to)
If you don’t encode, Discourse will not be happy and will error that URI must be ASCII only.

Another place to fix is when the plugin receives the response: wp-discourse/lib/sso-client/client.php at main · discourse/wp-discourse · GitHub
I’m not totally sure why urldecode and sanitize_text_field is used before the string is decoded, but once decoded, the sanitize_text_field call on the URL will strip all the encoded characters.
Possible suggestion: urldecode needs to be called before.

So far, those fixes seem to fix the issue gerald had.