Fix Charset.body_encode to encode to output_charset before calling base64mime.

This means that what gets encoded in base64 is the encoded version of the
unicode payload.  This bug was revealed by a forward port of the tests from
Issue 1368247, but the fix was completely different.

Note that the merge is only of the tests, the doc changes were inappropriate
since email5 expects unicode, not bytes.  I'm also not convinced that
quopri works correctly in email5, but that's a different issue.

Merged revisions 81658 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r81658 | r.david.murray | 2010-06-02 18:03:15 -0400 (Wed, 02 Jun 2010) | 9 lines

  #1368247: make set_charset/MIMEText automatically encode unicode _payload.

  Fixes (mysterious, to the end user) UnicodeErrors when using utf-8 as
  the charset and unicode as the _text argument.  Also makes the way in
  which unicode gets encoded to quoted printable for other charsets more
  sane (it only worked by accident previously).  The _payload now is encoded
  to the charset.output_charset if it is unicode.
........
diff --git a/Misc/NEWS b/Misc/NEWS
index 68f36fc..4c60de3 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -398,6 +398,10 @@
 Library
 -------
 
+- Charset.body_encode now correctly handles base64 encoding by encoding
+  with the output_charset before calling base64mime.encode.  Passes the
+  tests from 2.x issue 1368247.
+
 - Issue #8845: sqlite3 Connection objects now have a read-only in_transaction
   attribute that is True iff there are uncommitted changes.