Skip to content

Commit

Permalink
Change getUnicodeStream encoding from UTF-8 to UTF-16.
Browse files Browse the repository at this point in the history
The JDBC standard requires two-bytes encoding to be returned from
getUnicodeStream.
  • Loading branch information
nicktorwald committed May 21, 2019
1 parent 2c9cd80 commit d4d62e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/tarantool/jdbc/SQLResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,8 @@ public InputStream getAsciiStream(String columnLabel) throws SQLException {

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

@Override
Expand Down

0 comments on commit d4d62e9

Please sign in to comment.