I am working on an application where a ruby sidekiq process calls a 3rd party and parses the data into a database.
I am using sequel ad my orm.
I am getting some weird characters back in the results, for example:
"Tweets en Ingl\xE9s y en Espa\xF1ol"
When this gets attempted to save to postgres, the following error happens:
Sequel::DatabaseError: PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8": 0xe9 0x73 0x20
The weird thing is that the string thinks it is UTF-8, if I check the encoding name, it says:
name.encoding.name #UTF-8
What can I do to ensure that the data is in the correct format for postgres?