I am getting the
JSON::GeneratorError: source sequence is illegal/malformed utf-8
when I am using to_json
method. I have not overridden the to_json
method anywhere.
I have referred this question and also this one
But as Ruby 1.8 does not have the concept of string encodings the solution is not helping me.
How can I solve this issue without the requirement to escape the specific non-ascii characters?
I am on ruby 1.8.7