Skip to content
This repository has been archived by the owner on Sep 24, 2022. It is now read-only.

Encoding Unicode strings error #178

Closed
alanhdu opened this issue May 30, 2017 · 0 comments
Closed

Encoding Unicode strings error #178

alanhdu opened this issue May 30, 2017 · 0 comments

Comments

@alanhdu
Copy link
Contributor

alanhdu commented May 30, 2017

When encoding a unicode character, toml seems to accidentally convert unicode hex into decimal:

extern crate toml;
fn main() {
    let s = r#"
         q = "\u000B"
    "#;
    let data: toml::Value = toml::from_str(s).unwrap();
    println!("{:?}", data);
    println!("{}", toml::to_string(&data).unwrap());
}

outputs:

Table({"q": String("\u{b}")})
q = "\u0011"

Found with rust-fuzz/targets#72

@alanhdu alanhdu changed the title Encoding Unicode strings is wrong Encoding Unicode strings error May 30, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant