Hi Rob,
Apologies for the delayed response, we must have missed the original post.
UTF8 character encoding is not a good way to encode a byte array for database storage roundtrip. It may result in information loss particularly in the area of Unicode surrogate characters (0xD800 to 0xDBFF) as some byte sequences may not be a valid unicode surrogate character sequence. We would recommend you to use base64 character encoding instead as it will not result in information loss. We tested with the following code and it was working properly:
string docxText = string.Empty;
private void button1_Click(object sender, EventArgs e)
{
{
MemoryStream stream = new MemoryStream();
m_TextControl.View.SaveToStream(stream, new Nevron.Nov.Text.Formats.NDocxTextFormat());
docxText = Convert.ToBase64String(stream.ToArray());
}
}
private void button2_Click(object sender, EventArgs e)
{
{
MemoryStream stream = new MemoryStream(Convert.FromBase64String(docxText));
m_TextControl.View.LoadFromStream(stream, new Nevron.Nov.Text.Formats.NDocxTextFormat());
}
}
We hope this helps - let us know if you have any questions or meet any problems.
Best Regards,
Nevron Support Team