Raw strings to normal strings conversion?

Nagarajan naga86 at gmail.com
Thu Aug 23 11:21:40 CEST 2007

On Aug 23, 1:21 pm, James Stroud <jstr... at mbi.ucla.edu> wrote:
> Nagarajan wrote:
> > Is there a way by which I could obtain normal string form of a raw
> > string.
> > XML CDATA is returned as raw string. But I need the string to actually
> > escape special chars.
> > Any idea?
> This doesn't seem clear. Perhaps an example of what you get and what you
> want it converted to.

Here is an example:
>> rawstr = r'a\nb'
>> print rawstr

Now I need this newstr to actually interpret '\n', in other words, to
behave like a normal string.
> In the meantime, see if urllib.unquote() doesn't do what you need.
> James

And yes, unquote doesn't help.

More information about the Python-list mailing list