How to display chinese character in 65001 in pytohn?

L

length power

I am in win7 +python3.3.

import os
os.system("chcp 936")
fh=open("test.ch","w",encoding="utf-8")
fh.write("ä½ ")
fh.close()
os.system("chcp 65001")
fh=open("test.ch","r",encoding="utf-8").read()
print(fh)
Äãb'\xe4\xbd\xa0'

How can i display the chinese character `ä½ ` in 65001?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,577
Members
45,054
Latest member
LucyCarper

Latest Threads

Top