/ Check-in [33a12e73]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Instead of calling sqlite3_exec() to evaluate "PRAGMA encoding = UTF16" in sqlite3_open16(), set the connection encoding flag directly. (CVS 4959)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:33a12e737c343dbc452a25321a63456c1a8f7548
User & Date: danielk1977 2008-04-03 16:28:25
Context
2008-04-03
17:57
Changes speedtest8 and speedtest16 so that the database file can be specified on the command-line. Allows speed testing against a :memory: database. (CVS 4960) check-in: 64badc50 user: drh tags: trunk
16:28
Instead of calling sqlite3_exec() to evaluate "PRAGMA encoding = UTF16" in sqlite3_open16(), set the connection encoding flag directly. (CVS 4959) check-in: 33a12e73 user: danielk1977 tags: trunk
16:01
Add the speedtest8.c and speedtest16.c files to the tools subdirectory. (CVS 4958) check-in: b8d211a7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/main.c.

    10     10   **
    11     11   *************************************************************************
    12     12   ** Main file for the SQLite library.  The routines in this file
    13     13   ** implement the programmer interface to the library.  Routines in
    14     14   ** other files are for internal use by SQLite and should not be
    15     15   ** accessed by users of the library.
    16     16   **
    17         -** $Id: main.c,v 1.430 2008/04/01 15:06:34 drh Exp $
           17  +** $Id: main.c,v 1.431 2008/04/03 16:28:25 danielk1977 Exp $
    18     18   */
    19     19   #include "sqliteInt.h"
    20     20   #include <ctype.h>
    21     21   #ifdef SQLITE_ENABLE_FTS3
    22     22   # include "fts3.h"
    23     23   #endif
    24     24   
................................................................................
  1245   1245     sqlite3ValueSetStr(pVal, -1, zFilename, SQLITE_UTF16NATIVE, SQLITE_STATIC);
  1246   1246     zFilename8 = sqlite3ValueText(pVal, SQLITE_UTF8);
  1247   1247     if( zFilename8 ){
  1248   1248       rc = openDatabase(zFilename8, ppDb,
  1249   1249                         SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, 0);
  1250   1250       assert( *ppDb || rc==SQLITE_NOMEM );
  1251   1251       if( rc==SQLITE_OK ){
  1252         -      rc = sqlite3_exec(*ppDb, "PRAGMA encoding = 'UTF-16'", 0, 0, 0);
         1252  +      ENC(*ppDb) = SQLITE_UTF16NATIVE;
  1253   1253         if( rc!=SQLITE_OK ){
  1254   1254           sqlite3_close(*ppDb);
  1255   1255           *ppDb = 0;
  1256   1256         }
  1257   1257       }
  1258   1258     }
  1259   1259     sqlite3ValueFree(pVal);