I have a class with a field that uses serialize but found that some of my text get strange characters after inputting normal text. Is this something with encoding? How do I fix this?
I use Heroku with their postgresql database. When doing it in SQLite it works like a charm.
SQlite:
Ik zeg wat ik voel.
Doe ik ...
Postgres:
Ik zeg wat ik voel.â¨â¨ Doe ik ...
Thanks!
In the postgres you are interpreting UTF-8 bytes in ISO-8859-1. Given that in your post, there are 2x U+2028 line separators, whose UTF-8 representation is
0xE2 0x80 0xA8, which shows up likeâ¨when interpreted in ISO-8859-1, with the0x80in the middle being invisible control character that was not transmitted to your post.So the issue is whatever you are viewing the result in, is getting the correct bytes for UTF-8, but interpreting them as ISO-8859-1.