diff options
Diffstat (limited to 'sal/osl/w32')
-rw-r--r-- | sal/osl/w32/file_url.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sal/osl/w32/file_url.cxx b/sal/osl/w32/file_url.cxx index 8c525042ddef..a14f8d4b9b39 100644 --- a/sal/osl/w32/file_url.cxx +++ b/sal/osl/w32/file_url.cxx @@ -502,8 +502,10 @@ static std::optional<OUString> osl_decodeURL_(const OString& sUTF8) } } - return bValidEncoded ? OUString(aBuffer.getStr(), aBuffer.getLength(), RTL_TEXTENCODING_UTF8) - : std::optional<OUString>(); + if (!bValidEncoded) + return std::nullopt; + + return OStringToOUString(aBuffer, RTL_TEXTENCODING_UTF8); } static OUString osl_encodeURL_(std::u16string_view sURL) |