Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Re: Unicode/UTF-8 confusion
Carsten Haese
3/15/2008 7:03:00 PM
On Sat, 2008-03-15 at 12:09 -0400, Tom Stambaugh wrote:
> [...]
> I use simplejson to serialize html strings that the server is delivering to
> a browser. Since the apostrophe is a string terminator in javascript, I need
> to escape any apostrophe embedded in the html.
> [...]
simplejson escapes them for you:
>>> import simplejson
>>> s = " ' "
>>> simplejson.dumps(s)
'" \' "'
Why is this not good enough for your needs?
--
Carsten Haese
http://informixdb.sourc...
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Unicode/UTF-8 confusion
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password