Fixing encoding of payload passed by hub to a node
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.CharacterCodingException;
@@ -165,8 +166,8 @@ public String getBody() {
return null;
}
- public void setBody(String content) {
- setBody(content.getBytes());
+ public void setBody(String content) throws UnsupportedEncodingException {
+ setBody(content.getBytes(encoding));
}
public void setBody(byte[] content) {
