diff options
author | danielk1977 <danielk1977@noemail.net> | 2004-06-18 04:24:54 +0000 |
---|---|---|
committer | danielk1977 <danielk1977@noemail.net> | 2004-06-18 04:24:54 +0000 |
commit | bfd6cce56bbb02a96fd7599ff89e1e807fa2df29 (patch) | |
tree | e0d7c19ec2260b540dc806932b07a75dec67f2d9 /src/tokenize.c | |
parent | a2854229224e9e13eab1a9e9031057e6a259c38c (diff) | |
download | sqlite-bfd6cce56bbb02a96fd7599ff89e1e807fa2df29.tar.gz sqlite-bfd6cce56bbb02a96fd7599ff89e1e807fa2df29.zip |
Optimisation for unicode encoding conversion routines. (CVS 1614)
FossilOrigin-Name: 39a415eaa65964742e40b7ea4d471fa04007c6c9
Diffstat (limited to 'src/tokenize.c')
-rw-r--r-- | src/tokenize.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/tokenize.c b/src/tokenize.c index aacf745d4..7f7e981fd 100644 --- a/src/tokenize.c +++ b/src/tokenize.c @@ -15,7 +15,7 @@ ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.76 2004/05/31 23:56:43 danielk1977 Exp $ +** $Id: tokenize.c,v 1.77 2004/06/18 04:24:55 danielk1977 Exp $ */ #include "sqliteInt.h" #include "os.h" @@ -701,10 +701,18 @@ int sqlite3_complete(const char *zSql){ ** UTF-8. */ int sqlite3_complete16(const void *zSql){ - int rc; - char *zSql8 = sqlite3utf16to8(zSql, -1, SQLITE_BIGENDIAN); - if( !zSql8 ) return 0; - rc = sqlite3_complete(zSql8); - sqliteFree(zSql8); + sqlite3_value *pVal; + char *zSql8; + int rc = 0; + + pVal = sqlite3ValueNew(); + sqlite3ValueSetStr(pVal, -1, zSql, SQLITE_UTF16NATIVE, SQLITE_STATIC); + zSql8 = sqlite3ValueText(pVal, SQLITE_UTF8); + if( zSql8 ){ + rc = sqlite3_complete(zSql8); + sqliteFree(zSql8); + } + sqlite3ValueFree(pVal); return rc; } + |