'string_escape' in python 3
Nicholas Cole
nicholas.cole at gmail.com
Sat Apr 7 10:30:19 EDT 2012
On Sat, Apr 7, 2012 at 12:10 AM, Ian Kelly <ian.g.kelly at gmail.com> wrote:
>>>> import codecs
>>>> codecs.getdecoder('unicode_escape')(s)[0]
> 'Hello: this is a test'
>
> Cheers,
> Ian
Thanks, Ian. I had assumed that if a unicode string didn't have a
.decode method, then I couldn't use a decoder on it, so it hadn't
occurred to me to try that....
N.
More information about the Python-list
mailing list