2

I am working on a C# based application and came up with this problem of converting a string to UCS2 encoding. Basically, I have to take some text from XML and convert it to UCS2 and write this UCS2 code to a *.dat file.

Is there a way to do this (convert a string to UCS2 encoding) in C#.NET? if not, what are the options then?

Thanks,

Indigo
  • 2,887
  • 11
  • 52
  • 83

1 Answers1

0

There isn't an included Encoding in .NET that will convert the string to UCS-2 encoding. Your best bet is BigEndianUnicode or UTF-16, but these won't work very well.

Caleb Keith
  • 816
  • 4
  • 10