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'
2
  • Have you tried to dump and recreate your DB? Commented Aug 13, 2015 at 10:07
  • I've created a new database and I still have that issue. Commented Aug 13, 2015 at 10:47

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

3 Comments

I've tried with a new blank database and it didn't help.
I don't use a heroku, but I believe, there should be encoding setting for new database. robdodson.me/how-to-setup-postgresql-for-rails-and-heroku
That link doesn't say anything about database encoding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.