Convert htmlspecial characters using ruby

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" <baz>')
     # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"

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.

···

On 7/11/07, geetha <sangeetha.geethu05@gmail.com> wrote:

hi,

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

thanks,
sangeetha.S

also ERB::h might help ^^

···

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

On 7/11/07, geetha <sangeetha.geethu05@gmail.com> 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" <baz>')
     # => "Usage: foo &quot;bar&quot; &lt;baz&gt;"

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.

--
Marcin Raczkowski
---
Friends teach what you should know
Enemies Teach what you have to know