StringDataFormat.Raw not managed causing ArgumentException
Created by: micdenny
I was trying to print a string in a raw format (fixed string) but I'm getting an ArgumentException:
System.ArgumentException: Invalid StringDataFormat.
Parameter name: format
at Syroot.BinaryData.Extensions.StreamExtensions.Write(Stream stream, String value, StringDataFormat format, Encoding encoding, ByteConverter converter)
Look at the code it simply lack the case StringDataFormat.Raw:
implementation.
Work around if you're good with Unicode
rappresentation:
writer.Write(mystring.ToCharArray());
or this to manage the Encoding:
writer.Write(Encoding.UTF8.GetBytes(mystring));