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.sourceforge.net -- http://mail.python.org/mailman/listinfo/python-list