vcl/source/gdi/embeddedfontshelper.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 501a1491e3e48c30c2e977841976431bbd4e0d67
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Aug 9 15:34:17 2025 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Aug 9 14:08:30 2025 +0200

    Percent-encode temp font filename in the file URL
    
    Change-Id: Ia88bd0c61c39da33911cd0aae4e805bc0e11cea7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189254
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>
    Tested-by: Jenkins

diff --git a/vcl/source/gdi/embeddedfontshelper.cxx 
b/vcl/source/gdi/embeddedfontshelper.cxx
index e18bd575e4b2..b18ba402e3d7 100644
--- a/vcl/source/gdi/embeddedfontshelper.cxx
+++ b/vcl/source/gdi/embeddedfontshelper.cxx
@@ -18,6 +18,7 @@
 
 #include <osl/file.hxx>
 #include <rtl/bootstrap.hxx>
+#include <rtl/uri.hxx>
 #include <sal/log.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/embeddedfontshelper.hxx>
@@ -248,7 +249,9 @@ OUString EmbeddedFontsHelper::fileUrlForTemporaryFont( 
const OUString& fontName,
 
     OUString path = GetEmbeddedFontsRoot() + "fromdocs/";
     osl::Directory::createPath( path );
-    return path + filename;
+    return path
+           + rtl::Uri::encode(filename, rtl_UriCharClassPchar, 
rtl_UriEncodeIgnoreEscapes,
+                              RTL_TEXTENCODING_UTF8);
 }
 
 // Check if it's (legally) allowed to embed the font file into a document

Reply via email to