Skip to main content

restores

Function restores 

Source
pub fn restores(damaged: &str, candidate: &str) -> bool
Expand description

Whether candidate is damaged with its U+FFFD characters restored: each U+FFFD in damaged stands for one or two characters of candidate (a lost UTF-8 sequence may have been one or two code points), and every other character is equal. A candidate that itself carries a U+FFFD never matches.

Both strings come from remote answers, so the match is bounded: longer than RESTORE_MAX_CHARS never matches, and a candidate whose length the U+FFFDs cannot account for is refused before any alignment.