The string that is causing the problem is the £ character. I am typing it directly from my keyboard and am not copying it from anywhere else.
I put Sequel::Model.plugin :force_encoding, 'UTF-8' in my model file and it didn't fix the problem. On 13 August 2015 at 14:59, Jeremy Evans <[email protected]> wrote: > On Thursday, August 13, 2015 at 3:51:09 AM UTC-7, desbest wrote: >> >> I tried to insert this into my heroku postgres database. >> >> In Britain, if a child doesn't go to school for a day, the parent gets in >> big trouble and depending on the school, the parent might might require a >> written note **in advance**** or even be charged £60 a day for each >> day's absence. If teachers are going to implement strict punishments when >> school attendance isn't essential, why should teachers be allowed to strike? >> >> And got this error. >> >> Problem making a comment with ajax. PG::CharacterNotInRepertoire: ERROR: >> invalid byte sequence for encoding "UTF8": 0xa3 >> >> Sequel::Model.plugin :force_encoding, 'UTF-8' >> :encoding => 'utf8' >> >> >> >>> I've tried using a new blank database and it didn't help. >> >> > It sounds like your database is already in UTF-8 encoding. However, you > submitted a string that wasn't in UTF-8 encoding, which caused the database > to return an error instead of accepting the query. The force_encoding > plugin should make it so the models use UTF-8, but there are still cases > where things will not work. For example, if the string you give it is > marked as UTF-8 but contains non-UTF-8 data. Could you put together a self > contained example showing the problem? > > Thanks, > Jeremy > > -- > You received this message because you are subscribed to a topic in the > Google Groups "sequel-talk" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/sequel-talk/4JyMmS6Wz5U/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/sequel-talk. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
