My goal is to output a long string into a BlobColumn (Text) in SSIS script component and here’s the code to do it.
byte[] blobdata = GetBytes(notes.Substring(0, (notes.Length < 16000 ? notes.Length : 16000)));
blobdata = blobdata.SkipWhile(x => x == 0).ToArray(); //Remove the nulls?
Row.SCNotes.AddBlobData(blobdata);
When I open the file in notepad++ that I’ve output this field to, it looks like this
original string: abc
output: a[nul]b[nul]c[nul]
Am I doing anything wrong with the code? How can I not output the nulls?
Got it. Strings in C# are stored as utf16 which causes this issue
solved it by converting to utf8 which removed the nulls in between each character.