Skip to content

Commit 12c5cb9

Browse files
committed
Change default encoding to UTF-8 in JdbcExecutionContextDao
Resolves #3983
1 parent 398d52a commit 12c5cb9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/repository/dao/JdbcExecutionContextDao.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2021 the original author or authors.
2+
* Copyright 2006-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
1919
import java.io.ByteArrayInputStream;
2020
import java.io.ByteArrayOutputStream;
2121
import java.io.IOException;
22+
import java.nio.charset.StandardCharsets;
2223
import java.sql.PreparedStatement;
2324
import java.sql.ResultSet;
2425
import java.sql.SQLException;
@@ -74,7 +75,7 @@ public class JdbcExecutionContextDao extends AbstractJdbcBatchMetadataDao implem
7475
private static final String UPDATE_STEP_EXECUTION_CONTEXT = "UPDATE %PREFIX%STEP_EXECUTION_CONTEXT "
7576
+ "SET SHORT_CONTEXT = ?, SERIALIZED_CONTEXT = ? " + "WHERE STEP_EXECUTION_ID = ?";
7677

77-
private static final String CHARSET_NAME = "ISO-8859-1";
78+
private static final String CHARSET_NAME = StandardCharsets.UTF_8.name();
7879

7980
private static final int DEFAULT_MAX_VARCHAR_LENGTH = 2500;
8081

0 commit comments

Comments
 (0)