T
Tamir Khason
I have Windows Form application recieved data from clipboard and convert its
encoding based on some ruls. So doing following:
//from source[source] to multiple targets[targ1,targ2]
System.Text.Encoding targ1 = Encoding.GetEncoding("Target_1_code_name");
System.Text.Encoding targ2 = Encoding.GetEncoding("Target_2_code_name");
System.Text.Encoding source = Encoding.GetEncoding("Source_code_name");
byte[] sourceBytes = source.GetBytes(source);
byte[] targ1Bytes = Encoding.Convert(source, targ1, sourceBytes, 0,
sourceBytes.Length);
byte[] targ2Bytes = Encoding.Convert(source, targ2, sourceBytes, 0,
sourceBytes.Length);
string targ1String = source.GetString(targ1Bytes,0,targ1Bytes.Length);
string targ2String = source.GetString(targ2Bytes,0,targ2Bytes.Length);
BUT Nothing happens....(the source strings continue to be looking like it
was, target undepended). e.g.targ1String = targ2String =source;
What can be a problem
encoding based on some ruls. So doing following:
//from source[source] to multiple targets[targ1,targ2]
System.Text.Encoding targ1 = Encoding.GetEncoding("Target_1_code_name");
System.Text.Encoding targ2 = Encoding.GetEncoding("Target_2_code_name");
System.Text.Encoding source = Encoding.GetEncoding("Source_code_name");
byte[] sourceBytes = source.GetBytes(source);
byte[] targ1Bytes = Encoding.Convert(source, targ1, sourceBytes, 0,
sourceBytes.Length);
byte[] targ2Bytes = Encoding.Convert(source, targ2, sourceBytes, 0,
sourceBytes.Length);
string targ1String = source.GetString(targ1Bytes,0,targ1Bytes.Length);
string targ2String = source.GetString(targ2Bytes,0,targ2Bytes.Length);
BUT Nothing happens....(the source strings continue to be looking like it
was, target undepended). e.g.targ1String = targ2String =source;
What can be a problem