Skip to content

Commit

Permalink
use default charset in bytes assert
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-mkubik committed Nov 19, 2024
1 parent 9857661 commit e001bbb
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Object toObject(int index) throws SFException {

@Override
public byte[] toBytes(int index) throws SFException {
return isNull(index) ? null : toString(index).getBytes(StandardCharsets.UTF_8);
return isNull(index) ? null : toString(index).getBytes();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Object toObject(int index) throws SFException {

@Override
public byte[] toBytes(int index) throws SFException {
return isNull(index) ? null : toString(index).getBytes(StandardCharsets.UTF_8);
return isNull(index) ? null : toString(index).getBytes();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public Object toObject(int index) throws SFException {

@Override
public byte[] toBytes(int index) throws SFException {
return isNull(index) ? null : toString(index).getBytes(StandardCharsets.UTF_8);
return isNull(index) ? null : toString(index).getBytes();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public Object toObject(int index) throws SFException {

@Override
public byte[] toBytes(int index) throws SFException {
return isNull(index) ? null : toString(index).getBytes(StandardCharsets.UTF_8);
return isNull(index) ? null : toString(index).getBytes();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public byte[] getBytes(Object obj, int columnType, int columnSubType, Integer sc
return converters
.getStringConverter()
.getString(obj, columnType, columnSubType, scale)
.getBytes(StandardCharsets.UTF_8);
.getBytes();
case Types.BOOLEAN:
return converters.getBooleanConverter().getBoolean(obj, columnType)
? new byte[] {1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import static org.junit.Assert.assertTrue;

import java.nio.charset.StandardCharsets;
import java.nio.charset.Charset;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
Expand Down Expand Up @@ -68,7 +68,7 @@ protected void assertGetObjectIsCompatible(ResultSet resultSet, String expected)
protected void assertGetBytesIsCompatible(ResultSet resultSet, String expected)
throws SQLException {
TestUtil.assertEqualsIgnoringWhitespace(
expected, new String(resultSet.getBytes(1), StandardCharsets.UTF_8));
expected, new String(resultSet.getBytes(1), Charset.defaultCharset()));
}

protected void withFirstRow(
Expand Down

0 comments on commit e001bbb

Please sign in to comment.