devinus / poison

An incredibly fast, pure Elixir JSON library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

consider skipping unusual whitespace characters while parsing

michallepicki opened this issue · comments

Parser.parse!/2 was crashing for me despite the fact that the JSON I fetched from external service looked completely fine. It turns out that the JSON started with a zero-width non-breaking space (U+FEFF).

Shall we change this line to pattern match all whitespace characters (a list is available at wikipedia) instead of only '\s\n\t\r' ? How much it will hurt the performance?

I understand this case may be unusual, but apparently these things may happen.

JSX handles this JSON just fine.

Any thoughts on that? Shall I submit a PR? Should this be configurable in any way?