views:

71

answers:

0

My understanding is that string in .net is utf-16 by default. But when I copy my string to Clipboard, it is changed to sjis encoding (my OS is Japanese).

Here is what I am doing:

string myStringToCopy = "Some text Here";  
System.Windows.DataFormat myDataFormat =  DataFormats.GetDataFormat("MyFormat-V1");
Clipboard.SetData(myDataFormat.Name, myStringToCopy);
  • myStringToCopy is made up of concating many strings in actual app.
  • DataFormat name must be "MyFormat-V1".

When I open pasted data in texteditor, string is in sjis encoding.

Thank you.