Re: Multibyte Character References

Mark Dodwell
Sat, 08 Sep 2007 18:03:50 -0000

Thanks for the help Michael.

Eventually, I managed to sort this without having to reimport. Thought,
I''d post how in case somebody else got stuck in a similar way.

    Model.find_all.each do |m|
      content = m.content
      content = Iconv.iconv(''ISO-8859-1//TRANSLIT'',
''UTF-8'',
content).to_s
      m.update_attribute(:content, content)
    end

This translated the UTF-8 encoded chars into ISO-8859-1 encoded
equicalents. They are not the exact characters obviously, but close
approximations.