Index: src/func.c ================================================================== --- src/func.c +++ src/func.c @@ -14,11 +14,11 @@ ** ** There is only one exported symbol in this file - the function ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.158 2007/05/15 13:27:07 drh Exp $ +** $Id: func.c,v 1.159 2007/05/15 14:40:11 drh Exp $ */ #include "sqliteInt.h" #include /* #include */ #include @@ -1308,13 +1308,10 @@ { "max", -1, 1, SQLITE_UTF8, 1, minmaxFunc }, { "max", 0, 1, SQLITE_UTF8, 1, 0 }, { "typeof", 1, 0, SQLITE_UTF8, 0, typeofFunc }, { "length", 1, 0, SQLITE_UTF8, 0, lengthFunc }, { "substr", 3, 0, SQLITE_UTF8, 0, substrFunc }, -#ifndef SQLITE_OMIT_UTF16 - { "substr", 3, 0, SQLITE_UTF16LE, 0, sqlite3Utf16Substr }, -#endif { "abs", 1, 0, SQLITE_UTF8, 0, absFunc }, { "round", 1, 0, SQLITE_UTF8, 0, roundFunc }, { "round", 2, 0, SQLITE_UTF8, 0, roundFunc }, { "upper", 1, 0, SQLITE_UTF8, 0, upperFunc }, { "lower", 1, 0, SQLITE_UTF8, 0, lowerFunc }, Index: src/utf.c ================================================================== --- src/utf.c +++ src/utf.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** -** $Id: utf.c,v 1.47 2007/05/15 11:55:09 drh Exp $ +** $Id: utf.c,v 1.48 2007/05/15 14:40:11 drh Exp $ ** ** Notes on UTF-8: ** ** Byte-0 Byte-1 Byte-2 Byte-3 Value ** 0xxxxxxx 00000000 00000000 0xxxxxxx @@ -432,58 +432,10 @@ } } return (z-(char const *)zIn)-((c==0)?2:0); } -/* -** UTF-16 implementation of the substr() -*/ -void sqlite3Utf16Substr( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - int y, z; - unsigned char const *zStr; - unsigned char const *zStrEnd; - unsigned char const *zStart; - unsigned char const *zEnd; - int i; - - zStr = (unsigned char const *)sqlite3_value_text16(argv[0]); - zStrEnd = &zStr[sqlite3_value_bytes16(argv[0])]; - y = sqlite3_value_int(argv[1]); - z = sqlite3_value_int(argv[2]); - - if( y>0 ){ - y = y-1; - zStart = zStr; - if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){ - for(i=0; izStr; i++) RSKIP_UTF16BE(zStart); - }else{ - for(i=y; i<0 && zStart>zStr; i++) RSKIP_UTF16LE(zStart); - } - for(; i<0; i++) z -= 1; - } - - zEnd = zStart; - if( SQLITE_UTF16BE==SQLITE_UTF16NATIVE ){ - for(i=0; i