When opening a new connection on a shared cache, be careful not to
overwrite the encoding flag on the shared cache.  Ticket #1824. (CVS 3190)

FossilOrigin-Name: c8e5ceedee087098c04e3b6b8b82710de0563e77
diff --git a/src/callback.c b/src/callback.c
index e7ca3c6..2a87677 100644
--- a/src/callback.c
+++ b/src/callback.c
@@ -13,7 +13,7 @@
 ** This file contains functions used to access the internal hash tables
 ** of user defined functions and collation sequences.
 **
-** $Id: callback.c,v 1.14 2006/03/14 11:08:28 drh Exp $
+** $Id: callback.c,v 1.15 2006/05/24 12:43:27 drh Exp $
 */
 
 #include "sqliteInt.h"
@@ -362,6 +362,7 @@
     sqlite3HashInit(&p->idxHash, SQLITE_HASH_STRING, 0);
     sqlite3HashInit(&p->trigHash, SQLITE_HASH_STRING, 0);
     sqlite3HashInit(&p->aFKey, SQLITE_HASH_STRING, 1);
+    p->enc = SQLITE_UTF8;
   }
   return p;
 }
diff --git a/src/main.c b/src/main.c
index 5f0b89b..4a13cbb 100644
--- a/src/main.c
+++ b/src/main.c
@@ -14,7 +14,7 @@
 ** other files are for internal use by SQLite and should not be
 ** accessed by users of the library.
 **
-** $Id: main.c,v 1.339 2006/03/16 16:19:56 drh Exp $
+** $Id: main.c,v 1.340 2006/05/24 12:43:27 drh Exp $
 */
 #include "sqliteInt.h"
 #include "os.h"
@@ -851,9 +851,6 @@
   }
   db->aDb[0].pSchema = sqlite3SchemaGet(db->aDb[0].pBt);
   db->aDb[1].pSchema = sqlite3SchemaGet(0);
-  if( db->aDb[0].pSchema ){
-    ENC(db) = SQLITE_UTF8;
-  }
 
 
   /* The default safety_level for the main database is 'full'; for the temp