RReverser / serde-xml-rs

xml-rs based deserializer for Serde (compatible with 1.0+)
https://crates.io/crates/serde-xml-rs
MIT License
269 stars 90 forks source link

Regression : Fix xml-rs depencency version in Cargo.toml #206

Open Azel-ytof opened 1 year ago

Azel-ytof commented 1 year ago

Hi,

My application (since 1 year) use your lib - and thank you a lot for your work ! But I have face a problem... My last published version works fine, but my WIP version has encoding problems. I think that is because of encoding_rs but when I put logs to see where it comes from, this is your crate (not directly).

In fact, I have done a cargo tree comparison between my two versions, and I have see these differences (for v0.5.1) :

My prod version :

serde-xml-rs v0.5.1
├── log v0.4.17 (*)
├── serde v1.0.156 (*)
├── thiserror v1.0.39 (*)
└── xml-rs v0.8.4

My WIP version :

serde-xml-rs v0.5.1
├── log v0.4.19 (*)
├── serde v1.0.164 (*)
├── thiserror v1.0.40 (*)
└── xml-rs v0.8.14

The problem here is that xml-rs do not have the same version, and that cause for me encoding problem (because some XML are decoded in WINDOWS-1252 by the encoding_rs crate but when I parse the decoded string with your crate, I face an encoding problem).

So I think it may be usefull to fix the xml-rs version in your Cargo.toml to avoid some error like this one.

FIY, here is my code (if I do something bad and that's not from the crate version problem) :

#[derive(Debug, Deserialize)]
pub struct ListePa {
    #[serde(rename = "BIEN")]
    pub biens: Option<Vec<Bien>>,
}

fn parse_ac3(
    &self,
    content: String,
) -> Result<(), ErrorEntity> {
    // logging 'content' here has no encoding problem (decoded in a previous function)
    let parsing_result: Result<ac3::ListePa, serde_xml_rs::Error> =
        serde_xml_rs::from_str(&content);
    // logging 'parsing_result' here has encoding problem
    // ...... Some additionnal process ......
}

And the workaround wiating for your response : cargo update -p xml-rs --precise 0.8.4

At your disposition if you need more informations :)