diff options
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/databasecontext.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/filter/xml/xmlfilter.cxx | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx index b2cc08996dbf..6b0509fbc174 100644 --- a/dbaccess/source/core/dataaccess/databasecontext.cxx +++ b/dbaccess/source/core/dataaccess/databasecontext.cxx @@ -368,7 +368,11 @@ Reference< XInterface > ODatabaseContext::loadObjectFromURL(const OUString& _rNa if (bEmbeddedDataSource) { // In this case the host contains the real path, and the path is the embedded stream name. - OUString sBaseURI = aURL.GetHost(INetURLObject::DecodeMechanism::WithCharset) + aURL.GetURLPath(INetURLObject::DecodeMechanism::WithCharset); + OUString sBaseURI = + INetURLObject::encode(aURL.GetHost(INetURLObject::DecodeMechanism::WithCharset), + INetURLObject::PART_FPATH, INetURLObject::EncodeMechanism::All) + + INetURLObject::encode(aURL.GetURLPath(INetURLObject::DecodeMechanism::WithCharset), + INetURLObject::PART_FPATH, INetURLObject::EncodeMechanism::All); aArgs.put("BaseURI", sBaseURI); } diff --git a/dbaccess/source/filter/xml/xmlfilter.cxx b/dbaccess/source/filter/xml/xmlfilter.cxx index f386206bec66..a3acde8f6c94 100644 --- a/dbaccess/source/filter/xml/xmlfilter.cxx +++ b/dbaccess/source/filter/xml/xmlfilter.cxx @@ -311,8 +311,10 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor ) { // In this case the host contains the real path, and the path is the embedded stream name. INetURLObject aURL(sFileName); - sFileName = aURL.GetHost(INetURLObject::DecodeMechanism::WithCharset); - sStreamRelPath = aURL.GetURLPath(INetURLObject::DecodeMechanism::WithCharset); + sFileName = INetURLObject::encode(aURL.GetHost(INetURLObject::DecodeMechanism::WithCharset), + INetURLObject::PART_FPATH, INetURLObject::EncodeMechanism::All); + sStreamRelPath = INetURLObject::encode(aURL.GetURLPath(INetURLObject::DecodeMechanism::WithCharset), + INetURLObject::PART_FPATH, INetURLObject::EncodeMechanism::All); if (sStreamRelPath.startsWith("/")) sStreamRelPath = sStreamRelPath.copy(1); } |