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:
robtfm 2025-07-03 23:27:07 +01:00 committed by GitHub
parent 852fb84aa2
commit eed3085a37
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {