tagomoris / fluent-plugin-parser

Other
74 stars 23 forks source link

Fix forward error: invalid byte sequence in UTF-8 (2nd try) #3

Closed sonots closed 11 years ago

sonots commented 11 years ago

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 thoughts?

tagomoris commented 11 years ago

Meged, and add fixes below:

Thanks!