Home | History | Annotate | Download | only in orig

Lines Matching refs:ENC

9631   u8 enc;              /* Text encoding used by this database */
9824 #define ENC(db) ((db)->aDb[0].pSchema->enc)
10044 u8 enc; /* Text encoding handled by xCmp() */
10310 u8 enc; /* Text encoding - one of the SQLITE_UTF* values */
11873 SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int);
12988 u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
20697 assert( pMem->enc!=desiredEnc );
20698 assert( pMem->enc!=0 );
20713 if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
20729 pMem->enc = desiredEnc;
20765 if( pMem->enc==SQLITE_UTF8 ){
20786 if( pMem->enc==SQLITE_UTF16LE ){
20806 pMem->enc = desiredEnc;
20826 ** byte-swapping, it just sets Mem.enc appropriately.
20855 pMem->enc = bom;
20923 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
20927 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC);
20942 ** enc. A pointer to the new string is returned, and the value of *pnOut
20951 SQLITE_PRIVATE char *sqlite3Utf8to16(sqlite3 *db, u8 enc, char *z, int n, int *pnOut){
20956 if( sqlite3VdbeMemTranslate(&m, enc) ){
21290 ** uses the encoding enc. The string is not necessarily zero-terminated.
21307 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
21309 int incr = (enc==SQLITE_UTF8?1:2);
21323 if( enc==SQLITE_UTF16BE ) z++;
21458 return !sqlite3Atoi64(z, pResult, length, enc);
21509 ** given by enc.
21511 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){
21512 int incr = (enc==SQLITE_UTF8?1:2);
21519 if( enc==SQLITE_UTF16BE ) zNum++;
58393 if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
58406 assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
58407 assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
58552 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, int enc){
58582 pMem->enc = SQLITE_UTF8;
58584 sqlite3VdbeChangeEncoding(pMem, enc);
58717 sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
58740 sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc);
58822 if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){
58862 pMem->enc = SQLITE_UTF8;
59042 u8 enc, /* Encoding of z. 0 for BLOBs */
59063 flags = (enc==0?MEM_Blob:MEM_Str);
59065 assert( enc!=0 );
59066 if( enc==SQLITE_UTF8 ){
59081 nAlloc += (enc==SQLITE_UTF8?1:2);
59103 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
59104 pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT);
59107 if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
59191 assert( pMem1->enc==pMem2->enc );
59192 assert( pMem1->enc==SQLITE_UTF8 ||
59193 pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );
59202 if( pMem1->enc==pColl->enc ){
59215 v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
59217 v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
59279 pMem->enc = 0;
59303 ** (2006-02-16:) The enc value can be or-ed with SQLITE_UTF16_ALIGNED.
59307 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
59311 assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
59321 sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
59322 if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
59331 sqlite3VdbeMemStringify(pVal, enc);
59334 assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0
59336 if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
59369 u8 enc, /* Encoding to use */
59423 if( enc!=SQLITE_UTF8 ){
59424 sqlite3VdbeChangeEncoding(pVal, enc);
59428 if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) ){
59438 sqlite3ValueApplyAffinity(pVal, affinity, enc);
59480 u8 enc, /* Encoding to use */
59483 if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel);
59497 ** that it uses the encoding "enc"
59499 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
59501 if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){
60738 pMem->enc = SQLITE_UTF8;
60787 pMem->enc = SQLITE_UTF8;
60801 pMem->enc = SQLITE_UTF8;
60809 pMem->enc = SQLITE_UTF8;
62422 pMem->enc = pKeyInfo->enc;
62466 mem1.enc = pKeyInfo->enc;
62943 u8 enc, /* Encoding of z. 0 for BLOBs */
62946 if( sqlite3VdbeMemSetStr(&pCtx->s, z, n, enc, xDel)==SQLITE_TOOBIG ){
63797 rc = sqlite3VdbeChangeEncoding(pVar, ENC(p->db));
63895 pValue->enc);
64189 u8 enc = ENC(db);
64190 if( enc!=SQLITE_UTF8 ){
64194 sqlite3VdbeMemSetStr(&utf8, pVar->z, pVar->n, enc, SQLITE_STATIC);
64469 #define Stringify(P, enc) \
64470 if(((P)->flags&(MEM_Str|MEM_Blob))==0 && sqlite3VdbeMemStringify(P,enc)) \
64589 u8 enc = pRec->enc;
64591 if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return;
64592 if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){
64623 u8 enc /* Use this text encoding */
64631 sqlite3VdbeMemStringify(pRec, enc);
64666 u8 enc
64668 applyAffinity((Mem *)pVal, affinity, enc);
64712 sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]);
64747 sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]);
64979 u8 encoding = ENC(db); /* The database encoding */
65801 pOut->enc = encoding;
65839 pOut->enc = encoding;
66069 pOut->enc = encoding;
67264 u.an.pDest->enc = encoding;
67452 pOut->enc = SQLITE_UTF8; /* In case the blob is ever converted to text */
68036 u.ax.pKeyInfo->enc = ENC(p->db);
68128 u.ay.pCx->pKeyInfo->enc = ENC(p->db);
68155 u.az.pCx->pKeyInfo->enc = ENC(p->db);
69155 pOut->enc = SQLITE_UTF8; /* In case the blob is ever cast to text */
70519 pOut->enc = SQLITE_UTF8;
70900 testcase( u.cp.pName->enc==SQLITE_UTF8 );
70901 testcase( u.cp.pName->enc==SQLITE_UTF16BE );
70902 testcase( u.cp.pName->enc==SQLITE_UTF16LE );
73694 u8 enc = ENC(pParse->db); /* The database encoding */
73700 pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0);
73702 pDef = sqlite3FindFunction(pParse->db, zId, nId, -1, enc, 0);
74501 pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0);
75900 && sqlite3FindCollSeq(db, ENC(db), pIdx->azColl[0], 0)==pReq
76946 u8 enc = ENC(db); /* The text encoding used by this database */
76961 pDef = sqlite3FindFunction(db, zId, nId, nFarg, enc, 0);
78291 u8 enc = ENC(pParse->db);
78301 pExpr->x.pList ? pExpr->x.pList->nExpr : 0, enc, 0);
80538 }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
82081 sqlite3VdbeAddOp2(v, OP_Integer, ENC(db), reg3);
82468 u8 enc = ENC(db);
82472 pColl = sqlite3FindCollSeq(db, enc, zName, initbusy);
82474 pColl = sqlite3GetCollSeq(db, enc, pColl, zName);
84945 pColl = sqlite3FindCollSeq(db, ENC(db), zColl, 0);
85033 ** in the encoding enc of name zName, length nName.
85035 static void callCollNeeded(sqlite3 *db, int enc, const char *zName){
85040 db->xCollNeeded(db->pCollNeededArg, db, enc, zExternal);
85050 db->xCollNeeded16(db->pCollNeededArg, db, (int)ENC(db), zExternal);
85096 u8 enc, /* The desired encoding for the collating sequence */
85104 p = sqlite3FindCollSeq(db, enc, zName, 0);
85110 callCollNeeded(db, enc, zName);
85111 p = sqlite3FindCollSeq(db, enc, zName, 0);
85135 CollSeq *p = sqlite3GetCollSeq(db, ENC(db), pColl, zName);
85175 pColl[0].enc = SQLITE_UTF8;
85177 pColl[1].enc = SQLITE_UTF16LE;
85179 pColl[2].enc = SQLITE_UTF16BE;
85202 ** for the encoding 'enc' from the database 'db'.
85216 u8 enc,
85227 assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );
85228 if( pColl ) pColl += enc-1;
85235 ** that uses encoding enc. The value returned indicates how well the
85253 static int matchQuality(FuncDef *p, int nArg, u8 enc){
85262 if( enc==p->iPrefEnc ){
85265 else if( (enc==SQLITE_UTF16LE && p->iPrefEnc==SQLITE_UTF16BE) ||
85266 (enc==SQLITE_UTF16BE && p->iPrefEnc==SQLITE_UTF16LE) ){
85342 u8 enc, /* Preferred text encoding */
85351 assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
85358 int score = matchQuality(p, nArg, enc);
85383 int score = matchQuality(p, nArg, enc);
85400 pBest->iPrefEnc = enc;
85466 p->enc = SQLITE_UTF8;
93349 u8 enc;
93367 assert( encnames[SQLITE_UTF8].enc==SQLITE_UTF8 );
93368 assert( encnames[SQLITE_UTF16LE].enc==SQLITE_UTF16LE );
93369 assert( encnames[SQLITE_UTF16BE].enc==SQLITE_UTF16BE );
93370 sqlite3VdbeChangeP4(v, -1, encnames[ENC(pParse->db)].zName, P4_STATIC);
93373 /* Only change the value of sqlite.enc if the database handle is not
93374 ** initialized. If the main database exists, the new sqlite.enc value
93384 ENC(pParse->db) = pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE;
93891 ** main database, set sqlite3.enc to the encoding of the main database.
93893 ** as sqlite3.enc.
93898 /* If opening the main database, set ENC(db). */
93901 ENC(db) = encoding;
93904 /* If opening an attached database, the encoding much match ENC(db) */
93905 if( meta[BTREE_TEXT_ENCODING-1]!=ENC(db) ){
93915 pDb->pSchema->enc = ENC(db);
95271 pInfo->enc = ENC(db);
96379 pKeyInfo->enc = ENC(db);
96761 pKeyMerge->enc = ENC(db);
96801 pKeyDup->enc = ENC(db);
100505 u8 enc = ENC(sqlite3VdbeDb(v));
100509 sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc,
105063 assert( pColl->enc==SQLITE_UTF8 );
105071 z = (const u8 *)sqlite3ValueText(pVal, pColl->enc);
105077 n = sqlite3ValueBytes(pVal, pColl->enc);
105085 if( pColl->enc!=SQLITE_UTF8 ){
105088 db, pColl->enc, aSample[i].u.z, aSample[i].nByte, &nSample
113516 int enc,
113544 if( enc==SQLITE_UTF16 ){
113545 enc = SQLITE_UTF16NATIVE;
113546 }else if( enc==SQLITE_ANY ){
113557 enc = SQLITE_UTF16BE;
113560 enc = SQLITE_UTF8;
113568 p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)enc, 0);
113569 if( p && p->iPrefEnc==enc && p->nArg==nArg ){
113580 p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)enc, 1);
113610 int enc,
113616 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xFunc, xStep,
113624 int enc,
113643 rc = sqlite3CreateFunc(db, zFunc, nArg, enc, p, xFunc, xStep, xFinal, pArg);
114106 ** and the encoding is enc.
114111 u8 enc,
114126 enc2 = enc;
114155 if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){
114160 if( p->enc==pColl->enc ){
114175 pColl->enc = (u8)(enc2 | (enc & SQLITE_UTF16_ALIGNED));
114819 ENC(*ppDb) = SQLITE_UTF16NATIVE;
114836 int enc,
114843 rc = createCollation(db, zName, (u8)enc, pCtx, xCompare, 0);
114855 int enc,
114863 rc = createCollation(db, zName, (u8)enc, pCtx, xCompare, xDel);
114876 int enc,
114886 rc = createCollation(db, zName8, (u8)enc, pCtx, xCompare, 0);
133854 int enc; /* Optimal text encoding */
133882 db, p->zName, p->nArg, p->enc, p->pContext, p->xFunc, 0, 0