diff --git a/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java b/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java index 8dada5a..1baae40 100644 --- a/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java +++ b/serde/src/java/org/apache/hadoop/hive/serde2/SerDeUtils.java @@ -555,6 +555,6 @@ public static Text transformTextToUTF8(Text text, Charset previousCharset) { } public static Text transformTextFromUTF8(Text text, Charset targetCharset) { - return new Text(new String(text.getBytes()).getBytes(targetCharset)); + return new Text(new String(text.getBytes(), 0, text.getLength()).getBytes(targetCharset)); } }