diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java index 29e9dea139..d7cfdf6d1e 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/stomp/StompFrame.java @@ -181,7 +181,7 @@ public class StompFrame implements Command { buffer.append("\n"); if (getContent() != null) { try { - buffer.append(new String(getContent())); + buffer.append(new String(getContent(), "UTF-8")); } catch (Throwable e) { buffer.append(Arrays.toString(getContent())); } diff --git a/activemq-optional/src/main/java/org/apache/activemq/transport/ws/StompSocket.java b/activemq-optional/src/main/java/org/apache/activemq/transport/ws/StompSocket.java index bcaf331a07..430c11c4e5 100644 --- a/activemq-optional/src/main/java/org/apache/activemq/transport/ws/StompSocket.java +++ b/activemq-optional/src/main/java/org/apache/activemq/transport/ws/StompSocket.java @@ -49,7 +49,7 @@ class StompSocket extends TransportSupport implements WebSocket, StompTransport public void onMessage(byte frame, String data) { try { - protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes()))); + protocolConverter.onStompCommand((StompFrame)wireFormat.unmarshal(new ByteSequence(data.getBytes("UTF-8")))); } catch (Exception e) { onException(IOExceptionSupport.create(e)); }