Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jqnatividad/qsv
Browse files Browse the repository at this point in the history
  • Loading branch information
jqnatividad committed Mar 8, 2022
2 parents 10ea881 + dcf8ea1 commit a43c5b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ csv = "1.1"
csv-index = "0.1"
dateparser = "0.1"
docopt = "1"
encoding_rs_io = "0.1"
eudex = { version = "0.1", optional = true }
filetime = "0.2"
flexi_logger = { version = "0.22", features = ["compress"] }
Expand Down
6 changes: 5 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use std::io::{self, Read};
use std::ops::Deref;
use std::path::PathBuf;

use encoding_rs_io::DecodeReaderBytes;
use serde::de::{Deserialize, Deserializer, Error};

use crate::index::Indexed;
Expand Down Expand Up @@ -298,7 +299,10 @@ impl Config {
Ok(match self.path {
None => Box::new(io::stdin()),
Some(ref p) => match fs::File::open(p) {
Ok(x) => Box::new(x),
Ok(x) => {
let transcoded = DecodeReaderBytes::new(x);
Box::new(transcoded)
}
Err(err) => {
let msg = format!("failed to open {}: {}", p.display(), err);
return Err(io::Error::new(io::ErrorKind::NotFound, msg));
Expand Down

0 comments on commit a43c5b0

Please sign in to comment.