Better use `ITextDocument.Encoding` in case if it is not UTF8