I'm writing a Ruby program to fetch some code from the net and sometimes it had this error:
Error incomplete multibyte character.
I'm trying to escape()
the string using pg.
How can I handle this error? How can I convert the string to a valid UTF8 string?