1

I have to connect to a legacy postgres database which has ENCODING = 'SQL_ASCII';.

How do I set this encoding in my rails app?

1 Answer 1

3

You can set this in your database.yml:

development:
  adapter: postgresql
  encoding: sql_ascii
  database: appname_development
  username: root
  password:
  host: localhost
Sign up to request clarification or add additional context in comments.

1 Comment

Note: Order seems to matter: make sure your encoding is specified before your database name - this is what appears to have been causing the error for me.

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.