nerdEd/gtfs — pull request #8 by timclipsham (2012-12-18 22:32:12+00:00)
Title: Change read mode to take care of the BOM (if it exists)

Solved Issue #7 - discovered that I had the same issue with some of the TDX Program GTFS data (transport in Sydney, Australia; data only available if you register for it; https://tdx.131500.com.au).

Turned out some of the files were encoded in UTF-8 with BOM. The CSV reader prepends the 3 BOM bytes to the front of the first column "route_id" string which causes the gsub to fail, and therefore valid? returns false.

Reading the file using 'r:bom|utf-8' fixed the issue for me.