egui_extras: percent-decode file:// URIs in the file loader - #8342
Open
Lfan-ke wants to merge 1 commit into
Open
egui_extras: percent-decode file:// URIs in the file loader#8342Lfan-ke wants to merge 1 commit into
Lfan-ke wants to merge 1 commit into
Conversation
Signed-off-by: 林晨 (Leo Cheng) <leo-cheng@vip.qq.com>
|
Preview is being built... Preview will be available at https://egui-pr-preview.github.io/pr/8342-fix/file-loader-percent-decode View snapshot changes at kitdiff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FileLoaderstrips thefile://prefix but does not percent-decode the path,so a
file://URI with an escape such as%20fails to resolve on disk (thefunction's own doc noted "percent un-encoding are not handled").
convert_uri_to_pathnow decodes%XXescapes (e.g.%20-> space) afterstripping 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
%20cases to the existingcheck_convert_uri_to_pathtest forboth the Windows and non-Windows paths.
cargo test,clippy, andfmtpass foregui_extras.Closes #8288