Fech icon indicating copy to clipboard operation
Fech copied to clipboard

Read filing's contents using specified encoding

Open myersjustinc opened this issue 6 years ago • 3 comments

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 avatar Feb 07 '19 20:02 myersjustinc

@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.

dwillis avatar Feb 07 '19 20:02 dwillis

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?

myersjustinc avatar Feb 07 '19 20:02 myersjustinc

I would leave it open, as I'm unsure whether this repo is actively monitored.

dwillis avatar Feb 07 '19 20:02 dwillis