Skip to content

Commit d4d62e9

Browse files
committed
Change getUnicodeStream encoding from UTF-8 to UTF-16.
The JDBC standard requires two-bytes encoding to be returned from getUnicodeStream.
1 parent 2c9cd80 commit d4d62e9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/org/tarantool/jdbc/SQLResultSet.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,8 @@ public InputStream getAsciiStream(String columnLabel) throws SQLException {
295295

296296
@Override
297297
public InputStream getUnicodeStream(int columnIndex) throws SQLException {
298-
return new ByteArrayInputStream(getString(columnIndex).getBytes(Charset.forName("UTF-8")));
298+
String string = getString(columnIndex);
299+
return string == null ? null : new ByteArrayInputStream(string.getBytes(Charset.forName("UTF-16")));
299300
}
300301

301302
@Override

0 commit comments

Comments
 (0)