You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thread 'main' panicked at src/main.rs:2:5:
assertion `left == right` failed
left: ""
right: "after"
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I believe it is caused by the following fact:
use unicode_segmentation::UnicodeSegmentation;
fn main() {
let graphemes = "<p>\u{200D}</p>".graphemes(true).collect::<Vec<_>>();
assert_eq!(graphemes, ["<", "p", ">\u{200d}", "<", "/", "p", ">"]);
}
It is very hard to work correctly with unicode, and it is even more hard to make non-trivial assumptions (like a "grapheme is a character or something like that", or "nothing would be attached to a normal character in a grapheme") 😢
The text was updated successfully, but these errors were encountered:
Zero-width joiner is not the only one "character" in the Unicode that causes a mess. There are at least 2527 characters that cause exactly the same behavior, and here goes a script to obtain everything:
Long story short:
Leads to
I believe it is caused by the following fact:
It is very hard to work correctly with unicode, and it is even more hard to make non-trivial assumptions (like a "grapheme is a character or something like that", or "nothing would be attached to a normal character in a grapheme") 😢
The text was updated successfully, but these errors were encountered: