G
Guest
Hi,
Im using .Net 1.1 with Vs2003
Im trying to convert memorystream that im getting from
the clipboard into a unicode string ex.
//Set The clipboard data (unicode text file)....
StreamWriter sw = new StreamWriter(fileName, false, Encoding.Unicode);
sw.Write("Bla");
...
...
...
//Get the data from the clipboard
MemoryStream ms = dat.GetData( "Object Type" ) as System.IO.MemoryStream;
byte [] bytes = new byte[4096];
Encoding unicode = Encoding.Unicode;
while((count = ms.Read(bytes,0,4096)) > 0)
{
int result = unicode .GetCharCount(bytes, 0 ,count);
char [] chars = new char[result];
chars = unicode.GetChars(bytes, 0 , count);
//In This point the char array is not currect s.t unicode charecters are wrong
...
}
Same code is working fine with Encoding.ASCII
any known .Net 1.1 on this subject?
Thanks
Im using .Net 1.1 with Vs2003
Im trying to convert memorystream that im getting from
the clipboard into a unicode string ex.
//Set The clipboard data (unicode text file)....
StreamWriter sw = new StreamWriter(fileName, false, Encoding.Unicode);
sw.Write("Bla");
...
...
...
//Get the data from the clipboard
MemoryStream ms = dat.GetData( "Object Type" ) as System.IO.MemoryStream;
byte [] bytes = new byte[4096];
Encoding unicode = Encoding.Unicode;
while((count = ms.Read(bytes,0,4096)) > 0)
{
int result = unicode .GetCharCount(bytes, 0 ,count);
char [] chars = new char[result];
chars = unicode.GetChars(bytes, 0 , count);
//In This point the char array is not currect s.t unicode charecters are wrong
...
}
Same code is working fine with Encoding.ASCII
any known .Net 1.1 on this subject?
Thanks