[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: tool to encode html entities



On Thu, 16 Nov 2006 21:59:37 -0500, T wrote:

> Hi
> 
> Any tools can help me encode html entities? E.g.
> 
> from 
> 
>  sed "s/ /&nbsp;/g" < f1 > f2
> 
> to 
> 
>  sed &quot;s/ /&amp;nbsp;/g&quot; &lt; f1 &gt; f2
> 
> ?
> 
> thanks

hi, I found I'd like to talk to myself recently. :-)

$ echo 'sed "s/ /&nbsp;/g" < f1 > f2' | perl -MHTML::Entities -pe 'encode_entities($_)'
sed &quot;s/ /&amp;nbsp;/g&quot; &lt; f1 &gt; f2

Any tools other than Perl?

thanks

-- 
Tong (remove underscore(s) to reply)
  http://xpt.sourceforge.net/




Reply to: