C
Cheryl
I am sending a bytestream of Chinese characteratics through sockets. I need
to display the Chinese characters (possibly BIG5 words) in my Pocket PC.
How can I do that? The output only consists of question marks when I
implement the code below:
checkbox.Text = "";
String checkpath = @"\My Documents\~result.txt";
if (File.Exists(checkpath))
{
File.Delete(checkpath);
}
FileStream checkfs = File.Create(checkpath);
BinaryWriter checkw = new BinaryWriter
(checkfs,System.Text.Encoding.UTF8);
// Receive the transcribed text for verification first
byte[] bytes = new byte[resultClient.ReceiveBufferSize];
resultstream.Read(bytes,0,bytes.Length);
checkw.Write(bytes);
checkw.Close();
//Convert the bytes received to a string
String checking;
checkfs = new FileStream (checkpath,FileMode.Open,FileAccess.Read);
StreamReader checkr = new StreamReader(checkfs);
checking = checkr.ReadLine();
checkr.Close();
checkbox.Text = checking;
to display the Chinese characters (possibly BIG5 words) in my Pocket PC.
How can I do that? The output only consists of question marks when I
implement the code below:
checkbox.Text = "";
String checkpath = @"\My Documents\~result.txt";
if (File.Exists(checkpath))
{
File.Delete(checkpath);
}
FileStream checkfs = File.Create(checkpath);
BinaryWriter checkw = new BinaryWriter
(checkfs,System.Text.Encoding.UTF8);
// Receive the transcribed text for verification first
byte[] bytes = new byte[resultClient.ReceiveBufferSize];
resultstream.Read(bytes,0,bytes.Length);
checkw.Write(bytes);
checkw.Close();
//Convert the bytes received to a string
String checking;
checkfs = new FileStream (checkpath,FileMode.Open,FileAccess.Read);
StreamReader checkr = new StreamReader(checkfs);
checking = checkr.ReadLine();
checkr.Close();
checkbox.Text = checking;