rust-syndication / rss

Library for serializing the RSS web content syndication format
https://crates.io/crates/rss
Apache License 2.0
419 stars 52 forks source link

Encodings support #31

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hello! As far as I understand, it doesn't work with any non UTF-8 content. KOI8-R for example: http://www.opennet.ru/opennews/opennews_all.rss

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Parse(Utf8(Utf8Error { valid_up_to: 21 }))', ../src/libcore/result.rs:799

Is it possible to add support for other encodings?

frewsxcv commented 7 years ago

It might be that quick-xml, the XML library that this library uses, might not support non-UTF8 content. I haven't looked too closely, but it looks like all of their tests are UTF8 based.

ghost commented 7 years ago

@frewsxcv Yeah, it's true. I've created an issue tafia/quick-xml#46

tafia commented 7 years ago

I have just submitted a PR in quick-xml to support different encodings. The API is not very nice as people need to handle it manually somehow (the caller owns the decoder) but it should not be a very big change in existing code.

I would appreciate if you could give me a feedback before merging it.

frewsxcv commented 7 years ago

Wow, great! I appreciate the effort, but I'm a bit busy right now and won't be able to look too closely at that PR anytime soon, so don't let me hold it up. On a side note, I'm just going to add both of you to this organization in case either of you want to contribute directly to this project. Feel free to decline.

ghost commented 7 years ago

@frewsxcv, Sorry, but I have not enough time. Thanks for offering though.

frewsxcv commented 7 years ago

@Kilte No worries! :)

tafia commented 7 years ago

Hello guys. After a very long period working on other projects I've finally updated quick-xml to v0.6.0, This is a major upgrade with some nice performance improvements and also adds decoding support. I'll probably make a PR to upgrade rss repo soon.

frewsxcv commented 7 years ago

Fixed by https://github.com/rust-syndication/rss/pull/36