[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: convert htmlspecial characters using ruby

hemant

7/11/2007 9:06:00 AM

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.

1 Answer

Marcin Raczkowski

7/11/2007 9:18:00 AM

0

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.
also ERB::h might help ^^
--
Marcin Raczkowski
---
Friends teach what you should know
Enemies Teach what you have to know