I fixed this problem by changing the following code in NppExport that I found here https://github.com/chcg/NPP_ExportPlugin.
TXTExporter::exportData()
Before:
int totalBytesNeeded = ed->csd->nrChars;
After:
int totalBytesNeeded = ed->csd->nrChars + 1;
RTFExporter::exportData()
Before:
int totalBytesNeeded = 1; //zero terminator
After:
int totalBytesNeeded = 2; //zero terminator
HTMLExporter exportData()
Before:
int totalBytesNeeded = 1; //zero terminator
After:
int totalBytesNeeded = 2; //zero terminator
I hope this helps someone.
Thanks,
Darren