# Fix crash on non-ASCII thread titles in archive search \(\#53114\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/68452a3daea53843b9b388ec53a2cfd7673baac0)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 68452a3daea53843b9b388ec53a2cfd7673baac0

Requested commit: 68452a3daea53843b9b388ec53a2cfd7673baac0

Commit: 68452a3daea53843b9b388ec53a2cfd7673baac0

Tree: 5c992a6f552692e46391c949c3a7af542cc392d8

Author: Richard Feldman

Committer: GitHub

## Message

```
Fix crash on non-ASCII thread titles in archive search (#53114)

The archive view's `fuzzy_match_positions` used `chars().enumerate()`
which produces **character indices**, not **byte indices**. When thread
titles contain multi-byte UTF-8 characters (emoji, CJK, accented
characters, etc.), these character indices don't correspond to valid
byte boundaries, causing a panic in `HighlightedLabel::new` which
asserts that highlight indices are valid UTF-8 boundaries.

The fix switches to `char_indices()` and `eq_ignore_ascii_case()` to
produce correct byte positions, matching the approach already used by
the sidebar's version of the same function.

Release Notes:

- Fixed a crash when searching archived threads whose titles contain
emoji or other non-ASCII characters.
```

## Parents

- [5ae174fa5f811c154ed8f05de1c75c5ad5160790](https://git.cafe/gitcafe/zed/commit/5ae174fa5f811c154ed8f05de1c75c5ad5160790?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/68452a3daea53843b9b388ec53a2cfd7673baac0?format=markdown)
