Forum: Ferret multibyte character corrupt in highlight method

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5dff751ad47fd9c497d1632b4dd17529?d=identicon&s=25 sjoonk (Guest)
on 2007-01-25 06:42
When I apply highlight() method to the search result,
multibyte characters are corrupted.
The post_tag is located in the middle of last character,
so the last character corrupts.

Here is my code.

query = "SOME_MULTIBYTE_CHARS"
searcher.search_each(query) do |doc_id, score|
  puts searcher.highlight(query, doc_id, :field => :content)
end

And this is the result.

... bla, bla, bla, .. <b>SOME_MULTIBYTE_CHARA</b>CTERS ...

How can I do??
This topic is locked and can not be replied to.