I’m converting a Rails 2.3.8 app (on ruby 1.8.7) from MySQL to Postgres 9.x and while it everything appears to be working correctly in development mode all of my tests (standard unit and functional tests with yml fixtures) immediately error with the message:
test_mytest_name(my_thing_im_testing):
PGError: incomplete multibyte character
/usr/local/lib/ruby/1.8/erb.rb:719:in `inject'
The database.yml for test is:
test:
adapter: postgresql
encoding: utf8
database: ir_test
username: postgres
password: password
I suspect the issue is with loading the yml fixtures. I’ve verified that they are being saved as utf-8 (via Textmate), but no luck.
The error did turn out to be with the YML fixtures. I had been using the YAML DB gem to export some production data to be used as fixtures and it apparently doesn’t output the files as UTF-8 .
I ended up manually going through and removing “extra” spaces at the ends of the YML field declarations and everything started working.