diff options
author | Bruce Momjian <bruce@momjian.us> | 2000-09-12 04:58:50 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2000-09-12 04:58:50 +0000 |
commit | 65edb541865032b5750cfe58cb8f7affbe1fc298 (patch) | |
tree | 6f7c1aae279e75e5be4dceae692c8d3b2c9386a4 /src/interfaces/jdbc/org/postgresql/jdbc2 | |
parent | 4f5cdadf03ae97de4fbd9ef90e15a080291b6a13 (diff) |
Attached are a patch to allow the charset encoding used by the JDBC
driver to be set, and a description of said patch. Please refer to
the latter for more information.
William
--
William Webber william@peopleweb.net.au
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java index 85cb3c1f434..e9f6c79f41b 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/ResultSet.java @@ -164,7 +164,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); + } + } } /** |