added most required entires to foreign encoding table, plus some

* python/generator.py: added most required entires to
  foreign encoding table, plus some additional logic to
  assure only the 1st param uses the 't#' format.  Fixes
  bug #152286, but may still have some other UTF-16 problems.
diff --git a/python/generator.py b/python/generator.py
index cd72ce9..0b09b9a 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -300,7 +300,17 @@
 unknown_types = {}
 
 foreign_encoding_args = (
+    'htmlCreateMemoryParserCtxt',
+    'htmlCtxtReadMemory',
+    'htmlParseChunk',
+    'htmlReadMemory',
     'xmlCreateMemoryParserCtxt',
+    'xmlCtxtReadMemory',
+    'xmlCtxtResetPush',
+    'xmlParseChunk',
+    'xmlParseMemory',
+    'xmlReadMemory',
+    'xmlRecoverMemory',
 )
 
 #######################################################################
@@ -399,11 +409,8 @@
         c_args = c_args + "    %s %s;\n" % (arg[1], arg[0])
         if py_types.has_key(arg[1]):
             (f, t, n, c) = py_types[arg[1]]
-	    if name == 'xmlCreateMemoryParserCtxt':
-	        print "processing special case"
-	    if (f == 'z') and (name in foreign_encoding_args):
+	    if (f == 'z') and (name in foreign_encoding_args) and (num_bufs == 0):
 	        f = 't#'
-		print "changed 'f'"
             if f != None:
                 format = format + f
             if t != None: