fix(TCP协议): 优化字符串中文乱码的问题

This commit is contained in:
zhangji 2023-03-09 10:12:47 +08:00
parent 28b35d86da
commit 216946bc45
1 changed files with 3 additions and 3 deletions

View File

@ -157,9 +157,9 @@ public enum DataType {
@Override @Override
public void write(ByteBuf buf, Object value) { public void write(ByteBuf buf, Object value) {
String str = (String) value; byte[] bytes = ((String) value).getBytes();
buf.writeShort(str.length()); buf.writeShort(bytes.length);
buf.writeBytes(str.getBytes()); buf.writeBytes(bytes);
} }
}, },
//0x0C //0x0C