summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2019-07-13 16:39:31 +0200
committerAndras Timar <andras.timar@collabora.com>2019-08-05 09:53:31 +0200
commit30f97ed015f2c2d25d6a1545943363829355dbdc (patch)
tree2c742f0a8c9a1e3e7e805b1a8c33f183775e88aa /connectivity
parent587ab613e033845795a255a2f83aff023ea2ddf7 (diff)
tdf#123150: Firebird: set UTF-8 client connection
There are two options related to character sets when attaching or creating a database with the C API: - isc_dpb_lc_ctype: Sets the character set of the connection between the Firebird server and the Client (which is the sdbc driver in that case). That is required in order to pass UTF 8 literals correctly. - isc_dpb_set_db_charset: Sets the default character set of the database itself. It has the same effect as the following SQL statement: ALTER DATABASE SET DEFAULT CHARACTER SET <Charset> We need to set both of them to UTF-8. Change-Id: Ia9e5a4b87a3997c084be8abb68c2de813fbd631b Reviewed-on: https://gerrit.libreoffice.org/75557 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com> (cherry picked from commit c19c206cf42ac178906a855ae3cd198e0fcf8d14) Reviewed-on: https://gerrit.libreoffice.org/75755 Reviewed-by: Michael Stahl <Michael.Stahl@cib.de> Tested-by: Jenkins (cherry picked from commit 3173e00f428ea8cf79f36efb38d15028aca01d4a) Reviewed-on: https://gerrit.libreoffice.org/76928 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/firebird/Connection.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index ba2fba974d78..c707ca2c15ad 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -227,11 +227,15 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >&
dpbBuffer.push_back(1); // 1 byte long
dpbBuffer.push_back(FIREBIRD_SQL_DIALECT);
- // set UTF8 as default character set
+ // set UTF8 as default character set of the database
const char sCharset[] = "UTF8";
dpbBuffer.push_back(isc_dpb_set_db_charset);
dpbBuffer.push_back(sizeof(sCharset) - 1);
dpbBuffer.append(sCharset);
+ // set UTF8 as default character set of the connection
+ dpbBuffer.push_back(isc_dpb_lc_ctype);
+ dpbBuffer.push_back(sizeof(sCharset) - 1);
+ dpbBuffer.append(sCharset);
// Do any more dpbBuffer additions here