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.