fix panic looking for extension in multibyte unicode paths (#19933)
# Objective ``` 2025-07-03T11:48:34.039501Z ERROR panic: thread 'IO Task Pool (6)' panicked at 'byte index 9 is not a char boundary; it is inside '个' (bytes 7..10) of `展示_个人收款码.png`': [...]\crates\bevy_asset\src\path.rs:475 ``` ## Solution char_indices
This commit is contained in:
parent
852fb84aa2
commit
eed3085a37
@ -480,7 +480,7 @@ impl<'a> AssetPath<'a> {
|
||||
}
|
||||
|
||||
pub(crate) fn iter_secondary_extensions(full_extension: &str) -> impl Iterator<Item = &str> {
|
||||
full_extension.chars().enumerate().filter_map(|(i, c)| {
|
||||
full_extension.char_indices().filter_map(|(i, c)| {
|
||||
if c == '.' {
|
||||
Some(&full_extension[i + 1..])
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user