fix(TCP协议): 优化字符串中文乱码的问题
This commit is contained in:
parent
28b35d86da
commit
216946bc45
|
@ -157,9 +157,9 @@ public enum DataType {
|
|||
@Override
|
||||
public void write(ByteBuf buf, Object value) {
|
||||
|
||||
String str = (String) value;
|
||||
buf.writeShort(str.length());
|
||||
buf.writeBytes(str.getBytes());
|
||||
byte[] bytes = ((String) value).getBytes();
|
||||
buf.writeShort(bytes.length);
|
||||
buf.writeBytes(bytes);
|
||||
}
|
||||
},
|
||||
//0x0C
|
||||
|
|
Loading…
Reference in New Issue