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