Skip to content
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

SpreadsheetDocument::open fails with non-UTF-8 file #10

Open
Boscop opened this issue Dec 16, 2022 · 0 comments
Open

SpreadsheetDocument::open fails with non-UTF-8 file #10

Boscop opened this issue Dec 16, 2022 · 0 comments

Comments

@Boscop
Copy link

Boscop commented Dec 16, 2022

Hi, thanks for this great crate :)
I'm trying to convert an xlsx doc to csv using xlsx2csv which uses this crate:

> xlsx2csv Report.xlsx
thread 'main' panicked at 'open xlsx file: IoError(Error { kind: InvalidData, message: "stream did not contain valid UTF-8" })', C:\Users\me\.cargo\registry\src\github.com-1ecc6299db9ec823\xlsx2csv-0.4.3\src\main.rs:238:69

It's this line which does let xlsx = ooxml::document::SpreadsheetDocument::open(opt.xlsx).expect("open xlsx file");:
https://github.com/zitsen/xlsx2csv.rs/blob/936878449a7d5e123f16e142bf086926dda7177b/src/main.rs#L238

Would it be possible to add support for non-UTF-8 encodings? (E.g. using encoding_rs_io::DecodeReaderBytes.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant