diff --git a/src/lib.rs b/src/lib.rs index 9ac2a54..ca00060 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -703,10 +703,11 @@ impl> Iri { } if abs_path != base_path || abs_query.is_none() && base_query.is_some() { let number_of_shared_characters = abs_path - .bytes() - .zip(base_path.bytes()) + .chars() + .zip(base_path.chars()) .take_while(|(l, r)| l == r) - .count(); + .map(|(l, _)| l.len_utf8()) + .sum::(); // We decrease until finding a / let number_of_shared_characters = abs_path[..number_of_shared_characters] .rfind('/')