Metadecidim
Sign in

Process

Report a Bug

Rejected not yet on protocol

UTF8 & Unicode & Crashes

More of a gotcha for those in the English speaking world.

The default encoding in config/database.yml is unicode.

My ubuntu system defaults to UTF8 encoding, and when I installed postgres it defaulted to UTF8 encoding.

I was getting lots of "PG Invalid byte sequence for encoding UTF8" crashes and it took me awhile to workout what was going on.

I ended up trashing my database, changing the encoding in database.yml to utf8 and starting again. i.e: $ rake db:create db:migrate.

All has been good since.

It would be great to mention this in the installation instructions. i.e:

"Check your System and Postgres locale & character encoding. Decidim defaults to unicode, this will cause problems with if your System & Postgres are using another character encoding, such as UTF8.

Your options are:
1. Change the encoding in config/database.yml to reflect your Postgres database encoding.
2. Set the encoding of your Postgres database to unicode upon creation."

1 comment

  1. I'm afraid this is an issue with the system itself, not with Decidim, since we don't set anything specific about the database encoding.

    0 votes up 0 votes down

Sign in with your Atmosphere account to comment.