Make Realm and ProxyServer encoding Charsets instead of Strings, close #708