eyurtsev / fcsparser

A python parser for reading fcs files supporting FCS 2.0, 3.0, 3.1
MIT License
73 stars 43 forks source link

Added try/except statement for invalid unicode characters in heade #8

Closed natl closed 7 years ago

natl commented 7 years ago

Whilst it probably shouldn't be allowed under the FCS standard, at least one machine I work with (CellQuest Pro 6) produces FCS files that contain non-UTF8 characters.

This PR enables UnicodeDecodeError, which is thrown by illegal UTF-8 characters in the header, to be handled via string.decode("utf-8", errors="ignore") which will ignore any illegal bytes.

A warning is returned to the user, highlighting the problem.

(addresses #7)