On Sep 11, 2012, at 4:02 AM, Nila wrote:

> Hi,
> 
> Is there away to convert the HTML entities into UTF-8 character set, in ruby 
> 1.8.7? 
> (For example, if we consider "ö", convert the entity number "ö" into 
> "\303\266". Or at least converting the html entity to the character "ö" )

Here's what I do:

coder = HTMLEntities.new
foo = coder.decode(foo)

I tried CGI.unescapeHTML and hit some problems, but that might have been my 
source talking, since there were also custom entities declared in XML.

Walter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to