Fech
Fech copied to clipboard
Read filing's contents using specified encoding
The @encoding
instance variable on a Filing
object is ignored in methods such as
Filing#form_type
, which can lead to an ArgumentError
("invalid byte sequence in UTF-8"). Before the included change in lib/fech/filing.rb
is made, the included test case demonstrates such an error when we try to call Filing#summary
.
This change takes @encoding
into account when reading the filing from disk, which avoids the ArgumentError
.
(The entire test suite now only has two failing tests, both of which are addressed in #83 and don't appear to be related to this specific change.)
@myersjustinc Thanks for this! I am not sure if the folks at the NYT are still maintaining this, but I've got a fork here and would be happy to have this PR there.
Sounds good. Once I've filed a matching PR on dwillis/Fech, should I also leave this one open on this repo, or should I close this one to avoid confusion?
I would leave it open, as I'm unsure whether this repo is actively monitored.