diff --git a/extensions/gson/src/main/java/io/jsonwebtoken/gson/io/GsonDeserializer.java b/extensions/gson/src/main/java/io/jsonwebtoken/gson/io/GsonDeserializer.java index 75ac69b7..f08c37cd 100644 --- a/extensions/gson/src/main/java/io/jsonwebtoken/gson/io/GsonDeserializer.java +++ b/extensions/gson/src/main/java/io/jsonwebtoken/gson/io/GsonDeserializer.java @@ -19,6 +19,8 @@ import com.google.gson.Gson; import io.jsonwebtoken.io.DeserializationException; import io.jsonwebtoken.io.Deserializer; import io.jsonwebtoken.lang.Assert; +import io.jsonwebtoken.lang.Strings; + import java.io.IOException; public class GsonDeserializer implements Deserializer { @@ -54,6 +56,6 @@ public class GsonDeserializer implements Deserializer { } protected T readValue(byte[] bytes) throws IOException { - return gson.fromJson(new String(bytes), returnType); + return gson.fromJson(new String(bytes, Strings.UTF_8), returnType); } }