2

I tried to insert this into my heroku postgres database.

£

And got this error.

Problem making a comment with ajax. PG::CharacterNotInRepertoire: ERROR: invalid byte sequence for encoding "UTF8": 0xa3

I think my database's encoding is in CP850. How do I change it to UTF-8?

I'm using Sequel ORM

Using a Google search and seeing this answer, do I have to delete my database and create it again?

This doesn't work either.

Sequel::Model.plugin :force_encoding, 'UTF-8'

:encoding => 'utf8'
the Tin Man
  • 150,910
  • 39
  • 198
  • 279
desbest
  • 4,269
  • 11
  • 45
  • 76

1 Answers1

2

You cannot to change database encoding - not without some pretty ugly magic. The dump, and load is the most simple and safer steps.

Pavel Stehule
  • 33,657
  • 3
  • 68
  • 77