tagomoris/fluent-plugin-parser — pull request #3 by sonots (2013-02-16 07:37:31+00:00)
Title: Fix forward error: invalid byte sequence in UTF-8 (2nd try)

Continued from the pull request #2.

Now, the invalid byte sequence is replaced with `?`, and the replacement occurs only when ArgumentError (invalid byte sequence in ***) is raised.
In addition, non-utf8 byte and `reserve_data` option is supported.

BTW:

I think `e.message.index("invalid byte sequence in") == 0` is not a clean code, but I could not find another way to rescue the invalid byte error. Any idea?