Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.0.0
-
None
Description
QML can load files specified with encoded characters (for example, "file:/tmp/test%23123/test.png", where the '#' character is percent-encoded), but not when the directory separators are encoded.
For example, encoding the entire path as done here:
source: "file:" + encodeURIComponent("/tmp/test#123/test.png")
results in the error:
file://<$PWD>%2Ftmp%2Ftest%23123%2Ftest.png: File not found
(where <$PWD> is the working directory at invocation)
This can be worked around via a helper function:
function encodeURIComponents(uri) { return uri.split('/').map(encodeURIComponent).join('/') } source: "file:" + encodeURIComponents("/tmp/test#123/test.png")
Attachments
Issue Links
- resulted from
-
QTBUG-22396 QML Image component can't open files with # in name
- Closed
For Gerrit Dashboard: QTBUG-25981 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
28849,3 | Decode directory separators in source URLs | master | qt/qtdeclarative | Status: MERGED | +2 | 0 |