With ruby 1.8, snippets can sometimes end in the middle of a UTF-8 character, e.g. (note the "\303" at the end):
:snippet=>"Um die e-Mail vollst\303\244ndig sehen zu k\303\266nnen, muss HTML in Ihrem e-Mail Client aktiviert sein. Sie k\303"
This causes to_json to fail, and in turn heliotrope to return error messages:
irb(main):075:0> res.to_json
JSON::GeneratorError: partial character in source, but hit end
from (irb):75:in `to_json'
from (irb):75
from bin/heliotrope-console:69
The patch removes the last (possibly incomplete) non-ASCII character from the snippet (in Message.snippet) if heliotrope is running on 1.8.
With ruby 1.8, snippets can sometimes end in the middle of a UTF-8 character, e.g. (note the "\303" at the end):
This causes to_json to fail, and in turn heliotrope to return error messages:
The patch removes the last (possibly incomplete) non-ASCII character from the snippet (in Message.snippet) if heliotrope is running on 1.8.