New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encoding gets messed up for CDATA #108
Comments
|
This regresses in 4f3566b. |
|
The issue is in fn main() {
let string = String::from("baño");
assert_eq!(5, string.len());
assert_eq!(5, string.as_bytes().len());
assert_eq!(4, string.chars().count());
assert_eq!("baño", string);
let mut string2 = String::new();
for byte in string.bytes() {
string2.push(byte as char);
}
assert_eq!(7, string2.len());
assert_eq!(7, string2.as_bytes().len());
assert_eq!(5, string2.chars().count());
assert_eq!("baño", string2);
} |
|
Converting individual bytes to characters and pushing those individually is not the same as pushing a single multi-byte character. If I understand correctly, converting |
|
Ugh... my bad. Didn't thought about that. |
This applies to master and not to 0.18.1.
Copy this into
src/lib.rsand runcargo test:Basically this parses a string to a
roxmltreeand then reads the text from the cdata.bañoturns intobaño(that's why thestd::dbg!is there).The text was updated successfully, but these errors were encountered: