Backport r886205 by tmcguire from trunk to the 4.1 branch:
Backport r886205 by tmcguire from trunk to the 4.1 branch:

When inserting a file to the composer:

- Don't add a zero-terminator to the end
- Check if the content can still be encoded with the current charset.
  If not, change the mode to auto-charset detection.

CCBUG: 88781



svn path=/branches/KDE/4.1/kdepim/; revision=890879

lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi,lefou/kdepim-noakonadi