file.write(s.decode('gbk').encode('utf-8'))
i open the file c:\t1, to get 中文 in it
not 涓枃
-- 原始邮件 --
发件人: "MRAB";
发送时间: 2012年1月27日(星期五) 上午10:53
收件人: "python-list";
主题: Re: write 中文 into c:\t1
On 27/01/2012 02:4
On 01/26/2012 09:46 PM, contro opinion wrote:
s='\xd6\xd0\xce\xc4'
print s
中文
s1=s.decode('gbk').encode('utf-8')
print s1
涓
file=open('c:\\t1','w')
file.write(s1)
file.close()
> when i open c:\t1,i get 中文 in it,
> how can i write 涓 into c:\t1??
On 27/01/2012 02:46, contro opinion wrote:
|>>> s='\xd6\xd0\xce\xc4'
print s
中文
s1=s.decode('gbk').encode('utf-8')
print s1
涓枃
file=open('c:\\t1','w')
file.write(s1)
file.close()
|
when i open c:\t1,i get 中文 in it,
how can i write 涓枃 into c:\t1??
>>> file.write(p