Incomplete utf-8 byte sequence from index 0
BohuTANG opened this issue · 1 comments
BohuTANG commented
The code is:
#[test]
fn test_token() {
let input = "🍌This is a sentence with spaces, hahhahah haha ha";
let rke = r50k_base()?;
let _ = rke.split_by_token(input, true).unwrap();
}
Error:
called `Result::unwrap()` on an `Err` value: incomplete utf-8 byte sequence from index 0
Caused by this line:
It should be String::from_utf8_lossy
?