summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
index 497e401bde..e65cf80b55 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/ResultSet.java
@@ -163,7 +163,16 @@ public class ResultSet extends org.postgresql.ResultSet implements java.sql.Resu
wasNullFlag = (this_row[columnIndex - 1] == null);
if(wasNullFlag)
return null;
- return new String(this_row[columnIndex - 1]);
+ String encoding = connection.getEncoding();
+ if (encoding == null)
+ return new String(this_row[columnIndex - 1]);
+ else {
+ try {
+ return new String(this_row[columnIndex - 1], encoding);
+ } catch (UnsupportedEncodingException unse) {
+ throw new PSQLException("postgresql.res.encoding", unse);
+ }
+ }
}
/**