tdf#125286: Inform Firebird that we use UTF8 in paths
Use isc_dpb_utf8_filename for that, which is introduced in Firebird 2.5.
It is documented in Firebird's doc/README.connection_string_charset.txt.
Without this, on Windows, where UTF-8 is not a common "ANSI code page",
one would not be able to connect to a DB file that has non-ASCII chars
in path, because its UTF-8 representation would differ from 8-bit system
encoding used in the API used by Firebird.
This still does not enable full Unicode support, because of Firebird's
[CORE2172]/[CORE3172]. It may only improve experience when using paths
with characters representable in system encoding.
Change-Id: Ia31407b181266a2bf1b90bc8cfc71dd3f78b7cd6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121886
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index eb0c100..6d38af0 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -273,6 +273,10 @@
}
}
// use isc_dpb_utf8_filename to identify encoding of filenames
dpbBuffer.push_back(isc_dpb_utf8_filename);
dpbBuffer.push_back(0); // no filename here, it is passed to functions directly
ISC_STATUS_ARRAY status; /* status vector */
ISC_STATUS aErr;
const OString sFirebirdURL = OUStringToOString(m_sFirebirdURL, RTL_TEXTENCODING_UTF8);