简体   繁体   中英

Send Persian string from C# server to python client with socket

I use socket programming to connect a python program to a C# program. python code is client and C# code is server. C# code send a string to python with this code:

byte[] R=Encoding.UTF8.GetBytes("one string");
Client.Send(R);

and i receive data in python code with this:

data=sock.recv(16)
amount_received+=len(data)
print >> sys.stderr, 'received "%s" %data 

When i print recieved data: print >> sys.stderr, 'received "%s" %data , I just see some question marks. what must I do?

尝试

byte[] R = Encoding.Default.GetBytes("Persian String"); 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM