I have 2 applications in c# that are talking via windows messages App1: sends a message to App2
string msg=UserName+","+UserAge;
byte[] sarr =System.Text.Encoding.Default.GetBytes(msg);//
int len = sarr.Length;
COPYDATASTRUCT cds;
cds.dwData = (IntPtr)100;
cds.lpData = msg;
cds.cbData = len + 1;
result = SendMessage(hWnd, WM_COPYDATA, wParam, ref cds);
App2:receives the message from App1
COPYDATASTRUCT sentPara = new COPYDATASTRUCT();
Type mytype = sentPara.GetType();
sentPara = (COPYDATASTRUCT)message.GetLParam(mytype);
string[] parameters = sentPara.lpData.Split(',');
Problem: The username is in Russian and when i receive it in App2 i got question marks"???????", i think it's something in the encoding of byte array but i don't how to solve it