Convert htmlspecial characters using ruby


#1

hi,

I have to decode the html special character using ruby,
if any function is there like php htmlspecialchars_decode ().

thanks,
sangeetha.S


#2

On 7/11/07, geetha removed_email_address@domain.invalid wrote:

hi,

I have to decode the html special character using ruby,
if any function is there like php htmlspecialchars_decode ().

thanks,
sangeetha.S

If you want to escape HTML special charcaters then i guess following
would work:

CGI::escapeHTML('Usage: foo “bar” ')
# => “Usage: foo “bar” <baz>”

If thats not what you want, please look into documentation of CGI
class and i think you would find method that you are looking for.


#3

On Wednesday 11 July 2007 09:06, hemant wrote:

If you want to escape HTML special charcaters then i guess following would
work:

CGI::escapeHTML('Usage: foo “bar” ')
# => “Usage: foo “bar” <baz>”

If thats not what you want, please look into documentation of CGI
class and i think you would find method that you are looking for.
also ERB::h might help ^^