Description: If the file name contains symbols and you paste it file name into the header footer (used Menu\Format\Page style\...\FileName fields), some of them - "#", "%", "[" and "]", printed or previewed as UTF-8 code: %23, %25, % 5B, %5D Steps to Reproduce: 1. Create file with the symbol "[", "]", "#", "%" in the file name. 2. Insert its FileName in the upper footer with "Menu\Format\Page style\Upper footer\Edit\FileName field". 3. Preview or print file. Actual Results: symbols "[" "]" "#" "%" printing or previewed as UTF-8 codes Expected Results: symbols "[" "]" "#" "%" printing or previewed as symbols Reproducible: Always User Profile Reset: No Additional Info: 1) I have a file: "[1] name_of_file.xlsx", (or "*.ods" - it is not matter). When I printed it, I saw that the characters "[" and "]" were printed as "%5B" and "%5D". As it turned out, this is also visible when previewing the page. 2) I created a file named: "1-=!@#$%^&*()_+|{}[] name_file.ods" and saw that symbols "#", "%", "[" and "]" previewing or printing in the header footer in UTF-8: %23, %25, %5B, %5D
Created attachment 200988 [details] My test file. You can preview upper header to see UTF-8 codes.
Code pointer: SvxExtFileField::GetFormatted in editeng/source/items/flditem.cxx. It should fix handling of SvxFileFormat::NameOnly and SvxFileFormat::NameAndExt, where it uses wrong decode mechanism.
Let me update the code pointer. It turns out, that Calc has a separate function for its fields content; look at ScHeaderEditEngine::CalcFieldValue.
Hello. I added that patch to gerrit https://gerrit.libreoffice.org/c/core/+/196392
Didier Vidal committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/540d53505863665c43f1d4960c33bf960c543cdc tdf#166756 Do not use URL encoding for file name in header and footer It will be available in 26.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to didier-devel from comment #4) > Hello. I added that patch to gerrit > https://gerrit.libreoffice.org/c/core/+/196392 Feel free to close the report as fixed.