Skip to content

Conversation

@myersjustinc
Copy link

(Copied from nytimes#86 as requested.)

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 three failing tests, two of which are addressed in nytimes#83 and the third of which also is related to mappings; none of those appears to be related to this specific change.)

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"). 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`.
@dwillis dwillis merged commit b7cef7c into dwillis:master Feb 7, 2019
@dwillis
Copy link
Owner

dwillis commented Feb 7, 2019

Thank you, @myersjustinc!

@myersjustinc
Copy link
Author

No problem—thanks for merging it so quickly!

@myersjustinc myersjustinc deleted the read-filing-contents-with-encoding branch February 7, 2019 20:41
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

Successfully merging this pull request may close these issues.

2 participants