Fix encodings

Here is a pair of commits for encoding:
1. Allow unicode in the proxy dns address
2. Encode unicode dns address using xn-- prefix