From 7d1c7c59692b0c1422c3aded32375aeba43f4315 Mon Sep 17 00:00:00 2001 From: shaozhuguang Date: Tue, 4 Jun 2019 11:29:33 +0800 Subject: [PATCH] Change String.getBytes() to UTF-8 Encode ! --- .../transaction/DataAccountKVSetOperationBuilderImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/DataAccountKVSetOperationBuilderImpl.java b/source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/DataAccountKVSetOperationBuilderImpl.java index c0511e55..537efdf7 100644 --- a/source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/DataAccountKVSetOperationBuilderImpl.java +++ b/source/ledger/ledger-model/src/main/java/com/jd/blockchain/transaction/DataAccountKVSetOperationBuilderImpl.java @@ -32,10 +32,10 @@ public class DataAccountKVSetOperationBuilderImpl implements DataAccountKVSetOpe public DataAccountKVSetOperationBuilder set(String key, String value, long expVersion) { BytesValue bytesValue; if (JSONSerializeUtils.isJSON(value)) { - bytesValue = new BytesValueEntry(BytesValueType.JSON, value.getBytes()); + bytesValue = new BytesValueEntry(BytesValueType.JSON, BytesUtils.toBytes(value)); } else { - bytesValue = new BytesValueEntry(BytesValueType.TEXT, value.getBytes()); + bytesValue = new BytesValueEntry(BytesValueType.TEXT, BytesUtils.toBytes(value)); } operation.set(key, bytesValue, expVersion); return this;