Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > How to convert Unicode string to raw string escaped with HTML Entities

Reply
Thread Tools

How to convert Unicode string to raw string escaped with HTML Entities

 
 
ldng
Guest
Posts: n/a
 
      05-10-2007
Hi,

I'm looking for a way to convert en unicode string encoded in UTF-8 to
a raw string escaped with HTML Entities. I can't seem to find an easy
way to do it.

Quote from urllib will only work on ascii (which kind of defeat the
purpose imho) and escape from cgi doesn't seems to do anything with my
string.

Any suggestion ?

 
Reply With Quote
 
 
 
 
Tim Golden
Guest
Posts: n/a
 
      05-10-2007
ldng wrote:
> Hi,
>
> I'm looking for a way to convert en unicode string encoded in UTF-8 to
> a raw string escaped with HTML Entities. I can't seem to find an easy
> way to do it.
>
> Quote from urllib will only work on ascii (which kind of defeat the
> purpose imho) and escape from cgi doesn't seems to do anything with my
> string.


Probably worth having a look at this:

http://effbot.org/zone/unicode-convert.htm

TJG
 
Reply With Quote
 
 
 
 
ldng
Guest
Posts: n/a
 
      05-10-2007
On 10 mai, 11:03, Tim Golden <m...@timgolden.me.uk> wrote:
>
> Probably worth having a look at this:
>
> http://effbot.org/zone/unicode-convert.htm


Great ! You made my day

Thanks.


 
Reply With Quote
 
Tim Golden
Guest
Posts: n/a
 
      05-10-2007
ldng wrote:
> On 10 mai, 11:03, Tim Golden <m...@timgolden.me.uk> wrote:
>> Probably worth having a look at this:
>>
>> http://effbot.org/zone/unicode-convert.htm

>
> Great ! You made my day
>
> Thanks.


That's all right, but it's the effbot you
need to thank. (Hope Fredrik's reading this).

TJG
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
.NET-ey way to convert XML-encoded/escaped entities into normal characters/HTML? ASP .Net 2 06-20-2007 05:32 PM
Convert from unicode chars to HTML entities Steven D'Aprano Python 8 02-08-2007 05:58 PM
Convert Raw Text Escaped Characters to Characters nicholas.wakefield@gmail.com Java 2 07-11-2005 09:17 PM
HTML::Entities::encode() returning wrong(?) entities Jim Higson Perl Misc 3 07-25-2004 09:13 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57