From 9857661ceeb30752d3baf00081a398e380999d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Kubik?= Date: Mon, 18 Nov 2024 14:42:33 +0100 Subject: [PATCH] change charset in JSON converter for varchar --- .../java/net/snowflake/client/core/json/BytesConverter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/snowflake/client/core/json/BytesConverter.java b/src/main/java/net/snowflake/client/core/json/BytesConverter.java index a60badc81..eb1f80a5a 100644 --- a/src/main/java/net/snowflake/client/core/json/BytesConverter.java +++ b/src/main/java/net/snowflake/client/core/json/BytesConverter.java @@ -1,6 +1,7 @@ package net.snowflake.client.core.json; import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; import java.sql.Types; import net.snowflake.client.core.SFException; import net.snowflake.client.jdbc.ErrorCode; @@ -52,7 +53,7 @@ public byte[] getBytes(Object obj, int columnType, int columnSubType, Integer sc return converters .getStringConverter() .getString(obj, columnType, columnSubType, scale) - .getBytes(); + .getBytes(StandardCharsets.UTF_8); case Types.BOOLEAN: return converters.getBooleanConverter().getBoolean(obj, columnType) ? new byte[] {1}