On Sep 27, 6:39 pm, "Mark Tolonen" wrote:
> "Junaid" wrote in message
>
> news:0267bef9-9548-4c43-bcdf-b624350c8...@p23g2000vbl.googlegroups.com...
>
> >I want to do replacements in a utf-8 text file. example
>
> > f=open("test.txt","r") #this file is uft-8 encoded
> > raw = f.read()
> > txt = ra
"Junaid" wrote in message
news:0267bef9-9548-4c43-bcdf-b624350c8...@p23g2000vbl.googlegroups.com...
I want to do replacements in a utf-8 text file. example
f=open("test.txt","r") #this file is uft-8 encoded
raw = f.read()
txt = raw.decode("utf-8")
You can use the codecs module to open and d
Junaid wrote:
I want to do replacements in a utf-8 text file. example
f=open("test.txt","r") #this file is uft-8 encoded
raw = f.read()
txt = raw.decode("utf-8")
txt.replace{'English', ur'ഇംഗ്ലീഷ്') #replacing raw unicode string,
but not working
txt = txt.replace{'English', ur'ഇംഗ്ലീഷ്')
f
2009/9/27 Junaid :
> I want to do replacements in a utf-8 text file. example
>
> f=open("test.txt","r") #this file is uft-8 encoded
>
> raw = f.read()
> txt = raw.decode("utf-8")
>
> txt.replace{'English', ur'ഇംഗ്ലീഷ്') #replacing raw unicode string,
> but not working
>
> f.write(txt)
> f.close()
>