From 397179619fdfa0b4b15f62437a91bd17924e7678 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 8 Nov 2016 15:14:57 +0300 Subject: xmpp: always use UTF-8 for output --- juick-ws/src/main/java/com/juick/ws/s2s/Connection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'juick-ws/src/main/java/com/juick') diff --git a/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java b/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java index b187aa3e..83cc18ac 100644 --- a/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java +++ b/juick-ws/src/main/java/com/juick/ws/s2s/Connection.java @@ -13,6 +13,7 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import java.io.*; import java.net.Socket; +import java.nio.charset.Charset; import java.security.*; import java.security.cert.CertificateException; import java.util.UUID; @@ -142,7 +143,7 @@ public class Connection { parser = new MXParser(); parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); parser.setInput(new InputStreamReader(socket.getInputStream())); - writer = new OutputStreamWriter(socket.getOutputStream()); + writer = new OutputStreamWriter(socket.getOutputStream(), Charset.forName("UTF-8")); streamID = UUID.randomUUID().toString(); } } -- cgit v1.2.3