Go to the source code of this file.
Defines | |
#define | WRITE_UTF8(zOut, c) |
#define | WRITE_UTF16LE(zOut, c) |
#define | WRITE_UTF16BE(zOut, c) |
#define | READ_UTF16LE(zIn, c) |
#define | READ_UTF16BE(zIn, c) |
#define | READ_UTF8(zIn, zTerm, c) |
Functions | |
int | sqlite3Utf8Read (const unsigned char *z, const unsigned char *zTerm, const unsigned char **pzNext) |
int | sqlite3VdbeMemTranslate (Mem *pMem, u8 desiredEnc) |
int | sqlite3VdbeMemHandleBom (Mem *pMem) |
int | sqlite3Utf8CharLen (const char *zIn, int nByte) |
char * | sqlite3Utf16to8 (sqlite3 *db, const void *z, int nByte) |
int | sqlite3Utf16ByteLen (const void *zIn, int nChar) |
Variables | |
const int | sqlite3one = 1 |
static const unsigned char | sqlite3UtfTrans1 [] |
#define READ_UTF16BE | ( | zIn, | |||
c | ) |
{ \ c = ((*zIn++)<<8); \ c += (*zIn++); \ if( c>=0xD800 && c<0xE000 ){ \ int c2 = ((*zIn++)<<8); \ c2 += (*zIn++); \ c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ if( (c & 0xFFFF0000)==0 ) c = 0xFFFD; \ } \ }
Definition at line 119 of file utf.c.
Referenced by sqlite3Utf16ByteLen(), and sqlite3VdbeMemTranslate().
#define READ_UTF16LE | ( | zIn, | |||
c | ) |
{ \ c = (*zIn++); \ c += ((*zIn++)<<8); \ if( c>=0xD800 && c<0xE000 ){ \ int c2 = (*zIn++); \ c2 += ((*zIn++)<<8); \ c = (c2&0x03FF) + ((c&0x003F)<<10) + (((c&0x03C0)+0x0040)<<10); \ if( (c & 0xFFFF0000)==0 ) c = 0xFFFD; \ } \ }
Definition at line 108 of file utf.c.
Referenced by sqlite3Utf16ByteLen(), and sqlite3VdbeMemTranslate().
#define READ_UTF8 | ( | zIn, | |||
zTerm, | |||||
c | ) |
c = *(zIn++); \ if( c>=0xc0 ){ \ c = sqlite3UtfTrans1[c-0xc0]; \ while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \ c = (c<<6) + (0x3f & *(zIn++)); \ } \ if( c<0x80 \ || (c&0xFFFFF800)==0xD800 \ || (c&0xFFFFFFFE)==0xFFFE ){ c = 0xFFFD; } \ }
Definition at line 157 of file utf.c.
Referenced by sqlite3Utf8Read(), and sqlite3VdbeMemTranslate().
#define WRITE_UTF16BE | ( | zOut, | |||
c | ) |
{ \ if( c<=0xFFFF ){ \ *zOut++ = ((c>>8)&0x00FF); \ *zOut++ = (c&0x00FF); \ }else{ \ *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \ *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ *zOut++ = (0x00DC + ((c>>8)&0x03)); \ *zOut++ = (c&0x00FF); \ } \ }
Definition at line 96 of file utf.c.
Referenced by sqlite3VdbeMemTranslate().
#define WRITE_UTF16LE | ( | zOut, | |||
c | ) |
{ \ if( c<=0xFFFF ){ \ *zOut++ = (c&0x00FF); \ *zOut++ = ((c>>8)&0x00FF); \ }else{ \ *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \ *zOut++ = (c&0x00FF); \ *zOut++ = (0x00DC + ((c>>8)&0x03)); \ } \ }
Definition at line 84 of file utf.c.
Referenced by sqlite3VdbeMemTranslate().
#define WRITE_UTF8 | ( | zOut, | |||
c | ) |
{ \ if( c<0x00080 ){ \ *zOut++ = (c&0xFF); \ } \ else if( c<0x00800 ){ \ *zOut++ = 0xC0 + ((c>>6)&0x1F); \ *zOut++ = 0x80 + (c & 0x3F); \ } \ else if( c<0x10000 ){ \ *zOut++ = 0xE0 + ((c>>12)&0x0F); \ *zOut++ = 0x80 + ((c>>6) & 0x3F); \ *zOut++ = 0x80 + (c & 0x3F); \ }else{ \ *zOut++ = 0xF0 + ((c>>18) & 0x07); \ *zOut++ = 0x80 + ((c>>12) & 0x3F); \ *zOut++ = 0x80 + ((c>>6) & 0x3F); \ *zOut++ = 0x80 + (c & 0x3F); \ } \ }
Definition at line 64 of file utf.c.
Referenced by sqlite3VdbeMemTranslate().
int sqlite3Utf16ByteLen | ( | const void * | zIn, | |
int | nChar | |||
) |
Definition at line 452 of file utf.c.
References READ_UTF16BE, READ_UTF16LE, SQLITE_UTF16BE, and SQLITE_UTF16NATIVE.
Referenced by sqlite3Prepare16().
char* sqlite3Utf16to8 | ( | sqlite3 * | db, | |
const void * | z, | |||
int | nByte | |||
) |
Definition at line 430 of file utf.c.
References Mem::db, Mem::flags, sqlite3::mallocFailed, MEM_Dyn, MEM_Str, MEM_Term, sqlite3DbStrDup(), sqlite3VdbeChangeEncoding(), sqlite3VdbeMemRelease(), sqlite3VdbeMemSetStr(), SQLITE_STATIC, SQLITE_UTF16NATIVE, SQLITE_UTF8, and Mem::z.
Referenced by sqlite3_create_collation16(), sqlite3_create_function16(), and sqlite3Prepare16().
int sqlite3Utf8CharLen | ( | const char * | zIn, | |
int | nByte | |||
) |
Definition at line 375 of file utf.c.
References SQLITE_SKIP_UTF8.
Referenced by likeFunc(), sqlite3AlterRenameTable(), sqlite3EndTable(), and sqlite3Prepare16().
int sqlite3Utf8Read | ( | const unsigned char * | z, | |
const unsigned char * | zTerm, | |||
const unsigned char ** | pzNext | |||
) |
int sqlite3VdbeMemHandleBom | ( | Mem * | pMem | ) |
Definition at line 338 of file utf.c.
References Mem::enc, Mem::flags, MEM_Term, Mem::n, sqlite3VdbeMemMakeWriteable(), SQLITE_OK, SQLITE_UTF16BE, SQLITE_UTF16LE, and Mem::z.
Referenced by sqlite3VdbeMemSetStr().
Definition at line 194 of file utf.c.
References Mem::db, Mem::enc, Mem::flags, MEM_Dyn, MEM_Ephem, MEM_Static, MEM_Str, MEM_Term, sqlite3::mutex, Mem::n, READ_UTF16BE, READ_UTF16LE, READ_UTF8, sqlite3_mutex_held, sqlite3DbMallocRaw(), sqlite3VdbeMemMakeWriteable(), sqlite3VdbeMemRelease(), SQLITE_NOMEM, SQLITE_OK, SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8, WRITE_UTF16BE, WRITE_UTF16LE, WRITE_UTF8, Mem::z, and Mem::zMalloc.
Referenced by sqlite3VdbeChangeEncoding().
const int sqlite3one = 1 |
const unsigned char sqlite3UtfTrans1[] [static] |
{ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x00, 0x01, 0x02, 0x03, 0x00, 0x01, 0x00, 0x00, }
ContextLogger2—ContextLogger2 Logger Daemon Internals—Generated on Mon May 2 13:50:02 2011 by Doxygen 1.6.1