use encoding on open for #1939 (#1949)

* WIP - not compiling

* compiling but panicing

* still broken

* nearly working

* reverted deserializer_string changes
updated enter.rs and open.rs to use Option<Tagged<String>>
Accepted Clippy suggestions
Accepted fmt suggestions
Left original code from open.rs
 We may want to use some of it and only fallback to encoding.

* Don't exit when there is an unknown encoding.

* When encoding is unknown default to utf-8.

* only do encoding if the user says to it

* merged some conflicts on open

* made error messages consistent

* Updated unwrap with expect

* updated open test to pass with more descriptive err
updated enter test to not fail

* change _location to location

* changed _visitor to visitor

* Added a more verbose usage statement for encoding
Linked to docs.rs/encoding_rs for details

Co-authored-by: Darren Schroeder <fdncred@hotmail.com>
This commit is contained in:
Darren Schroeder
2020-06-11 19:37:43 -05:00
committed by GitHub
parent a268e825aa
commit 731aa6bbdd
6 changed files with 357 additions and 18 deletions

View File

@ -225,6 +225,6 @@ fn errors_if_file_not_found() {
"open i_dont_exist.txt"
);
assert!(actual.err.contains("File could not be opened"));
assert!(actual.err.contains("file not found"));
//assert!(actual.err.contains("File could not be opened"));
assert!(actual.err.contains("Cannot open"));
}