Bug #85336
closedf:uri.image behaves inconsistent with utf8 names whether using src or image
0%
Description
I have a file with special utf8 characters in the path: /fileadmin/special-páth/file.pdf
(notice the "á" in the path name).
First I did this: {f:uri.image(src: file.originalResource.publicUrl)}
- this returned an empty string.
Then I did this: {f:uri.image(image: file)}
- this returned the correct path.
SYS\UTF8filesytem => true
is set and the filesystem actually is UTF-8 capable, the locales also are set to UTF8 and all other utf8-scenarios are working. Both methods (src and image) are working fine on ASCII-only paths.
I assume this mis-behaviour is also true for other view helpers such as f:image
.
Updated by S P over 6 years ago
The last sentence should end with "other view helpers such as f:image
.", sorry.
Updated by S P over 6 years ago
Oh, I forgot to mention (just in case that was not clear), the problem is NOT that publicUrl
returns empty! publicUrl
returns the correct path with special characters. So doing <a href="{file.originalResource.publicUrl}">Foo</a>
renders a working link to the file. Only the combination with the uri (and probably also image) VH does not work.
Updated by Frans Saris over 6 years ago
You shouldn't use {f:uri.image(src: file.originalResource.publicUrl)}
always use the object when possible! Did is faster and when you use fileReferences the cropping wil get lost this way.
Updated by S P over 6 years ago
You are right. But this does not change anything that there's some bug wrt to handling utf-8 paths somewhere. This is what I have reported.
Updated by Susanne Moog about 6 years ago
- Target version changed from 8.7.19 to Candidate for patchlevel
Updated by Susanne Moog over 4 years ago
- Status changed from New to Closed
This is not a misbehaviour or even a bug. publicUrl returns the public url - which is actually urlencoded. This is not the plain file name or path but the urlencoded one.
For example:
public URL: fileadmin/%C3%A4f%C3%B6ld%C3%A4r/special-p%C3%A1th.png
path: fileadmin/äföldär/special-páth.png
with the encoded path the image view helper is unable to find the file and therefor cannot render anything, as it expects the plain file path.
If you try and hardcode the path: {f:uri.image(src: "fileadmin/äföldär/special-páth.png")} - you'll note that this in fact does work.