Encoding about Korean language..

  • Thread starter Thread starter shine choi
  • Start date Start date
S

shine choi

Hi..All

I want to socket communication between PDA and Desktop PC.
The PDA is ipaq3850, ipqp3660.
It works well..

But, there are problems that when sending and receiveing
data using korean language, the data is invalid.
But, English's data are transfered well.

So i encoded the data below source code.
But, it doesn't work.
{
..
reader = new StreamReader(stream,Encoding.UTF8);
writer = new StreamWriter(stream,Encoding.UTF8);
..

receive_data = reader.ReadLine();
listbox1.Items.Add(receive_data);
..
}


I also used Encoding.Ascii, Encoding.Unicode.
But, it doesn't work.


How can i resolve it?
I must send and receive data which is written Korean
language.

Help me...

Have a nice day..
 
Hi Shine,

Do you know what's the original encoding of the data you are trying to
transmit?
If it's in a different encoding than UTF-8 it will not work.
Would you mind posting a more complete description of the code that you are
using?
 
Thank you for your answer.. ^_^

Server Program is composed with Delphi and VC++.
Delphi and VC++ is based on ANSI String.
I know that PPC is based on UNICODE. Is it right?
So, i also thought that "System.Text.Encoding.Default"
means "Unicode".
But it means "Ansi"

So,I solved that using "system.text.encoding.default."
I don't know well it is solution.
Any other ways?

//////////////////////////////////////////
{
..
reader = new StreamReader
(stream,System.Text.Encoding.Default);
writer = new StreamWriter
(stream,System.Text.Encoding.Default);
..

receive_data = reader.ReadLine();
listbox1.Items.Add(receive_data);
..
}
//////////////////////////////////////////
 
System.Text.Encoding.Default is the default encoding that the OS uses. What
you need to know is witch encoding is the text file on the PPC using
(System.Text.Encoding.Default is a good guess). once you read it you can
write it again using any encoding that you want ( I'd recommend UTF-8),
then you just need to copy it to the desktop and read it using UTF-8
encoding again.

Hope this helps,
Fernando
 
Back
Top