Environment
- Elixir & Erlang versions (elixir --version): elixir 1.4.0, Erlang 19
- Operating system: OSX 10.12.1
Current behavior
I am opening an utf-8 file with File.stream! with the default setting (read lines) like
File.stream!("my_file.txt")
> Enum.map(...)
When trying to match the first line to something expected it fails. It took me quite long to find out that the first line contains 3 extra bytes in the beginning (the BOM, https://de.wikipedia.org/wiki/Byte_Order_Mark).
I solved it in my project with adding the BOM to the expectation
<<239, 187, 191>> <> "HEADER" = line
This might be brittle (when the BOM changes) and confusing.
Expected behavior
When using :line mode or (as Jose suggested at elixirforum) another option :strip_bom is given, the bom should be skipped.