When I serialize a hash containing UTF8 strings, like this:
poll.variants = {0 => 'тест',1 => '-тест-',2 => 'test # test "тест'}
to an ActiveRecord field, the resulting field contains:
---
0: !binary |
0YLQtdGB0YI=
1: !binary |
LdGC0LXRgdGCLQ==
2: !binary |
dGVzdCAjIHRlc3QgItGC0LXRgdGC
The utf8 strings get treated as binary and base64 encoded for some reason. The collation on the field is utf8_general_ci
, and I'm a bit disappointed.
Is there any way to make ActiveRecord :serialize human-readable yaml to the field?