473,320 Members | 1,853 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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 ?

May 10 '07 #1
3 5172
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
May 10 '07 #2
On 10 mai, 11:03, Tim Golden <m...@timgolden.me.ukwrote:
>
Probably worth having a look at this:

http://effbot.org/zone/unicode-convert.htm
Great ! You made my day :-)

Thanks.
May 10 '07 #3
ldng wrote:
On 10 mai, 11:03, Tim Golden <m...@timgolden.me.ukwrote:
>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
May 10 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Alexander.Veit | last post by:
Hallo, does anyone know how to convert HTML Entities into UCS2-String (Value). For example: I need to convert Sułowska 43 (value in mysql database) to a unicode string with the specified...
8
by: Steven D'Aprano | last post by:
I have a string containing Latin-1 characters: s = u"© and many more..." I want to convert it to HTML entities: result => "&copy; and many more..." Decimal/hex escapes would be...
2
by: | last post by:
I've written an app to parse an XML RSS feed. Some of the content in that RSS feed has entities properly encoded for XML, e.g.: UW&apos;s Hawes To Enter NBA Draft High school&apos;s...
2
by: neovantage | last post by:
hey geeks, I am using a function which convert unicode to entities. So that i can save values into mysql database into entities. This function really helps me when i display the store entity data...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.