mirror of
https://github.com/storytold/egui.git
synced 2026-11-20 09:33:00 +01:00
`FileLoader` strips the `file://` prefix but does not percent-decode the path, so a `file://` URI with an escape such as `%20` fails to resolve on disk (the function's own doc noted "percent un-encoding are not handled"). `convert_uri_to_path` now decodes `%XX` escapes (e.g. `%20` -> space) after stripping the scheme, using a small inline decoder so no dependency is added. Invalid or truncated escapes are left as-is, and UTF-8 multibyte sequences round -trip. Added `%20` cases to the existing `check_convert_uri_to_path` test for both the Windows and non-Windows paths. `cargo test`, `clippy`, and `fmt` pass for `egui_extras`. Closes #8288 --------- Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com> Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>