Fixed an issue with characters not being properly encoded.

Some characters were not properly being encoded both when they were read from HTTP, to when they were stored in the database, to when they were returned from the user. For survey responses, this has been fixed. It may be worth looking into other areas where user-supplied data may use certain character sets.

Closes #560