html codes

  • Thread starter Daniel Fetchinson
  • Start date
D

Daniel Fetchinson

Hi folks,

I came across a javascript library that returns all sorts of html
codes in the cookies it sets and I need my web framework (written in
python :)) to decode them. I'm aware of htmlentitydefs but
htmlentitydefs.entitydefs.keys( ) are of the form '&#xxx' but this
javascript library uses stuff like '%3A' for the ':' for example. The
conversion is here:

http://www.ascii.cl/htmlcodes.htm

Is there a python package/module/whatever that does the conversion for
me or do I have to write a little wrapper myself (and introduce bugs
while doing so :))?

Cheers,
Daniel
 
P

Peter Otten

Daniel said:
I came across a javascript library that returns all sorts of html
codes in the cookies it sets and I need my web framework (written in
python :)) to decode them. I'm aware of htmlentitydefs but
htmlentitydefs.entitydefs.keys( ) are of the form '&#xxx' but this
javascript library uses stuff like '%3A' for the ':' for example. The
conversion is here:

http://www.ascii.cl/htmlcodes.htm

Is there a python package/module/whatever that does the conversion for
me or do I have to write a little wrapper myself (and introduce bugs
while doing so :))?
Löblich ähnlich üblich

If you care about the encoding you have to encode/decode explicitly:
u'L\xf6blich \xe4hnlich \xfcblich'

Peter
 
D

Daniel Fetchinson

I came across a javascript library that returns all sorts of html
Löblich ähnlich üblich

If you care about the encoding you have to encode/decode explicitly:

u'L\xf6blich \xe4hnlich \xfcblich'

Thanks a lot guys!

Cheers,
Daniel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top