Forum: Ruby on Rails Rubyful-soup and 'malformed utf-8 character'

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Scott Fortmann-Roe (Guest)
on 2006-05-17 14:35
(Received via mailing list)
Hi Guys,

I am trying to use Rubyful-soup for a simple webpage modification
project. The issue is that when I try to display the modified html
(generated by @soup.to_s) using RJS, an error pops up saying
'malformed utf-8 character'.

I can fix this by using @soup.to_s.toutf8 but that causes some of the
characters in the document to be messed up (ie '&nbsp becomes %nbsp').

Any ideas how to fix this, (or alternativly a different html parser,
rubyful soup seems the easiest one out there to use.

Thanks a lot,
This topic is locked and can not be replied to.