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
  • 158,662
  • 42
  • 215
  • 303
desbest
  • 4,746
  • 11
  • 51
  • 84

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
  • 42,331
  • 5
  • 91
  • 94