dockyard/postgres_ext — pull request #82 by lfittl (2013-05-17 18:28:50+00:00)
Title: Add support for SQL_ASCII encoding for Arrays

In some cases (mostly local development databases), a PostgreSQL database might be accidentally in the SQL_ASCII encoding instead of UTF8.

Right now this fails with postgres_ext if you are loading an array from the database, since there is no encoding called "SQL_ASCII" in Ruby, so force_encoding fails.

This is a really simple fix and just adds a "SQL_ASCII" => "ASCII" mapping, which fixes the error.

I did not provide a test, since the existing code does not have a test, and the mapping already exists for "UTF8" => "UTF-8".