Skip to content

Commit db78073

Browse files
committed
Fix charset
1 parent a2a31ee commit db78073

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
import org.elasticsearch.xpack.esql.session.IndexResolver;
9595

9696
import java.io.IOException;
97+
import java.nio.charset.StandardCharsets;
9798
import java.time.Period;
9899
import java.util.ArrayList;
99100
import java.util.List;
@@ -3553,7 +3554,10 @@ private static FieldCapabilitiesIndexResponse fieldCapabilitiesIndexResponse(
35533554
String indexName,
35543555
Map<String, IndexFieldCapabilities> fields
35553556
) {
3556-
String indexMappingHash = new String(MessageDigests.sha256().digest(fields.toString().getBytes()));
3557+
String indexMappingHash = new String(
3558+
MessageDigests.sha256().digest(fields.toString().getBytes(StandardCharsets.UTF_8)),
3559+
StandardCharsets.UTF_8
3560+
);
35573561
return new FieldCapabilitiesIndexResponse(indexName, indexMappingHash, fields, false, IndexMode.STANDARD);
35583562
}
35593563

0 commit comments

Comments
 (0)