Index: activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTunnelServlet.java =================================================================== --- activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTunnelServlet.java (revision 552825) +++ activemq-optional/src/main/java/org/apache/activemq/transport/http/HttpTunnelServlet.java (working copy) @@ -98,8 +98,9 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - // Read the command directly from the reader - Command command = (Command) wireFormat.unmarshalText(request.getReader()); + // Read the command directly from the reader, assuming UTF8 encoding + ServletInputStream sis = request.getInputStream(); + Command command = (Command) wireFormat.unmarshalText(new InputStreamReader(sis, "UTF-8") ); if (command instanceof WireFormatInfo) { WireFormatInfo info = (WireFormatInfo) command; Index: activemq-optional/src/main/java/org/apache/activemq/transport/util/TextWireFormat.java =================================================================== --- activemq-optional/src/main/java/org/apache/activemq/transport/util/TextWireFormat.java (revision 552825) +++ activemq-optional/src/main/java/org/apache/activemq/transport/util/TextWireFormat.java (working copy) @@ -40,11 +40,17 @@ public abstract String marshalText(Object command); public void marshal(Object command, DataOutput out) throws IOException { - out.writeUTF(marshalText(command)); + String text = marshalText(command); + byte[] utf8 = text.getBytes("UTF-8"); + out.writeInt(utf8.length); + out.write(utf8); } public Object unmarshal(DataInput in) throws IOException { - String text = in.readUTF(); + int length = in.readInt(); + byte[] utf8 = new byte[length]; + in.readFully(utf8); + String text = new String(utf8, "UTF-8"); return unmarshalText(text); }