Decoding html entities in nodejs

2,638 views
Skip to first unread message

lollicode

unread,
Apr 3, 2010, 4:59:29 AM4/3/10
to nodejs
Hi all,

Within node I get the content of a remote web page, but need to decode
html entities.

How would you do this in node ? I can't seem to find a lib or function
in "general" javascript that does the trick.

Thanks!

Jan Schütze

unread,
Apr 3, 2010, 12:31:19 PM4/3/10
to nod...@googlegroups.com
You mean something like php's html_entity_decode? There is a pretty
good one available at phpjs
http://phpjs.org/functions/html_entity_decode:424

regards,

> --
> You received this message because you are subscribed to the Google Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/nodejs?hl=en.
>
>

--

http://dracoblue.net

lollicode

unread,
Apr 6, 2010, 7:53:29 AM4/6/10
to nodejs
Thanks, that's the one :)

On Apr 3, 6:31 pm, Jan Schütze <J...@DracoBlue.de> wrote:
> You mean something like php's html_entity_decode? There is a pretty

> good one available at phpjshttp://phpjs.org/functions/html_entity_decode:424


>
> regards,
>
>
>
>
>
> On Sat, Apr 3, 2010 at 10:59 AM, lollicode <lollic...@gmail.com> wrote:
> > Hi all,
>
> > Within node I get the content of a remote web page, but need to decode
> > html entities.
>
> > How would you do this in node ? I can't seem to find a lib or function
> > in "general" javascript that does the trick.
>
> > Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups "nodejs" group.
> > To post to this group, send email to nod...@googlegroups.com.
> > To unsubscribe from this group, send email to nodejs+un...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/nodejs?hl=en.
>
> --
>

>  http://dracoblue.net- Hide quoted text -
>
> - Show quoted text -

Morteza Milani

unread,
Jan 24, 2012, 9:01:04 AM1/24/12
to nod...@googlegroups.com
Take the case of requesting a page that is encoded with windows-1256 
( and it is in the form of html entities ) using request module.

Request saves response data in a buffer and buffers convert the string
to utf8 when toString is called. So how should I decode html entities
and convert windows1256 to utf8 correctly?

Matt

unread,
Jan 24, 2012, 9:27:01 AM1/24/12
to nod...@googlegroups.com
Use node-iconv.


You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at

Reply all
Reply to author
Forward
0 new messages