Lines Matching refs:enc

13732   u8 enc;              /* Text encoding used by this database */  member
13879 u8 enc; /* Text encoding */ member
13992 #define SCHEMA_ENC(db) ((db)->aDb[0].pSchema->enc)
13993 #define ENC(db) ((db)->enc)
14285 u8 enc; /* Text encoding handled by xCmp() */ member
14577 u8 enc; /* Text encoding - one of the SQLITE_UTF* values */ member
16496 SQLITE_PRIVATE CollSeq *sqlite3FindCollSeq(sqlite3*,u8 enc, const char*,int);
17820 u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */ member
26882 assert( pMem->enc!=desiredEnc );
26883 assert( pMem->enc!=0 );
26898 if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
26914 pMem->enc = desiredEnc;
26950 if( pMem->enc==SQLITE_UTF8 ){
26969 if( pMem->enc==SQLITE_UTF16LE ){
26990 pMem->enc = desiredEnc;
27039 pMem->enc = bom;
27107 SQLITE_PRIVATE char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
27111 sqlite3VdbeMemSetStr(&m, z, nByte, enc, SQLITE_STATIC);
27548 SQLITE_PRIVATE int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
27563 assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
27566 if( enc==SQLITE_UTF8 ){
27572 for(i=3-enc; i<length && z[i]==0; i+=2){}
27575 z += (enc&1);
27720 return !sqlite3Atoi64(z, pResult, length, enc);
27774 SQLITE_PRIVATE int sqlite3Atoi64(const char *zNum, i64 *pNum, int length, u8 enc){
27783 assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
27784 if( enc==SQLITE_UTF8 ){
27789 for(i=3-enc; i<length && zNum[i]==0; i+=2){}
27792 zNum += (enc&1);
68739 if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){
68752 assert(rc==SQLITE_OK || pMem->enc!=desiredEnc);
68753 assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc);
68935 SQLITE_PRIVATE int sqlite3VdbeMemStringify(Mem *pMem, u8 enc, u8 bForce){
68964 pMem->enc = SQLITE_UTF8;
68967 sqlite3VdbeChangeEncoding(pMem, enc);
69122 sqlite3Atoi64(pMem->z, &value, pMem->n, pMem->enc);
69145 sqlite3AtoF(pMem->z, &val, pMem->n, pMem->enc);
69220 if( 0==sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc) ){
69323 pMem->enc = SQLITE_UTF8;
69506 u8 enc, /* Encoding of z. 0 for BLOBs */
69527 flags = (enc==0?MEM_Blob:MEM_Str);
69529 assert( enc!=0 );
69530 if( enc==SQLITE_UTF8 ){
69546 nAlloc += (enc==SQLITE_UTF8?1:2);
69571 pMem->enc = (enc==0 ? SQLITE_UTF8 : enc);
69574 if( pMem->enc!=SQLITE_UTF8 && sqlite3VdbeMemHandleBom(pMem) ){
69664 static SQLITE_NOINLINE const void *valueToText(sqlite3_value* pVal, u8 enc){
69667 assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
69675 if( pVal->enc != (enc & ~SQLITE_UTF16_ALIGNED) ){
69676 sqlite3VdbeChangeEncoding(pVal, enc & ~SQLITE_UTF16_ALIGNED);
69678 if( (enc & SQLITE_UTF16_ALIGNED)!=0 && 1==(1&SQLITE_PTR_TO_INT(pVal->z)) ){
69686 sqlite3VdbeMemStringify(pVal, enc, 0);
69689 assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0
69691 if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){
69708 SQLITE_PRIVATE const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){
69711 assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) );
69713 if( (pVal->flags&(MEM_Str|MEM_Term))==(MEM_Str|MEM_Term) && pVal->enc==enc ){
69719 return valueToText(pVal, enc);
69773 assert( pRec->pKeyInfo->enc==ENC(db) );
69821 u8 enc, /* Encoding to use */
69839 pFunc = sqlite3FindFunction(db, p->u.zToken, nVal, enc, 0);
69854 rc = sqlite3ValueFromExpr(db, pList->a[i].pExpr, enc, aff, &apVal[i]);
69876 rc = sqlite3VdbeChangeEncoding(pVal, enc);
69915 u8 enc, /* Encoding to use */
69942 rc = valueFromExpr(db, pExpr->pLeft, enc, aff, ppVal, pCtx);
69978 if( enc!=SQLITE_UTF8 ){
69979 rc = sqlite3VdbeChangeEncoding(pVal, enc);
69983 if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal)
69995 sqlite3ValueApplyAffinity(pVal, affinity, enc);
70018 rc = valueFromFunction(db, pExpr, enc, affinity, &pVal, pCtx);
70050 u8 enc, /* Encoding to use */
70054 return valueFromExpr(db, pExpr, enc, affinity, ppVal, 0);
70286 pMem->enc = ENC(db);
70317 u8 enc, /* Encoding to use */
70320 if( v ) sqlite3VdbeMemSetStr((Mem *)v, z, n, enc, xDel);
70337 static SQLITE_NOINLINE int valueBytes(sqlite3_value *pVal, u8 enc){
70338 return valueToText(pVal, enc)!=0 ? pVal->n : 0;
70340 SQLITE_PRIVATE int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){
70343 if( (p->flags & MEM_Str)!=0 && pVal->enc==enc ){
70354 return valueBytes(pVal, enc);
71989 pMem->enc = SQLITE_UTF8;
72035 pMem->enc = SQLITE_UTF8;
72047 pMem->enc = SQLITE_UTF8;
72057 pMem->enc = SQLITE_UTF8;
73885 pMem->enc = pKeyInfo->enc;
73926 mem1.enc = pKeyInfo->enc;
74051 if( pMem1->enc==pColl->enc ){
74065 v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
74067 v2 = sqlite3ValueText((sqlite3_value*)&c2, pColl->enc);
74183 assert( pMem1->enc==pMem2->enc || pMem1->db->mallocFailed );
74184 assert( pMem1->enc==SQLITE_UTF8 ||
74185 pMem1->enc==SQLITE_UTF16LE || pMem1->enc==SQLITE_UTF16BE );
74374 mem1.enc = pKeyInfo->enc;
74929 preupdate.keyinfo.enc = ENC(db);
75255 u8 enc, /* Encoding of z. 0 for BLOBs */
75258 if( sqlite3VdbeMemSetStr(pCtx->pOut, z, n, enc, xDel)==SQLITE_TOOBIG ){
75352 unsigned char enc
75356 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
75360 setResultStrOrError(pCtx, z, (int)n, enc, xDel);
76331 unsigned char enc
76337 if( enc==SQLITE_UTF16 ) enc = SQLITE_UTF16NATIVE;
76338 return bindText(pStmt, i, zData, (int)nData, xDel, enc);
76373 pValue->enc);
76991 u8 enc = ENC(db);
76992 if( enc!=SQLITE_UTF8 ){
76995 sqlite3VdbeMemSetStr(&utf8, pVar->z, pVar->n, enc, SQLITE_STATIC);
77017 if( enc!=SQLITE_UTF8 ) sqlite3VdbeMemRelease(&utf8);
77206 #define Stringify(P, enc) \
77207 if(((P)->flags&(MEM_Str|MEM_Blob))==0 && sqlite3VdbeMemStringify(P,enc,0)) \
77304 u8 enc = pRec->enc;
77306 if( sqlite3AtoF(pRec->z, &rValue, pRec->n, enc)==0 ) return;
77307 if( 0==sqlite3Atoi64(pRec->z, &iValue, pRec->n, enc) ){
77338 u8 enc /* Use this text encoding */
77358 sqlite3VdbeMemStringify(pRec, enc, 1);
77388 u8 enc
77390 applyAffinity((Mem *)pVal, affinity, enc);
77402 if( sqlite3AtoF(pMem->z, &pMem->u.r, pMem->n, pMem->enc)==0 ){
77405 if( sqlite3Atoi64(pMem->z, &pMem->u.i, pMem->n, pMem->enc)==SQLITE_OK ){
77469 sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]);
77504 sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]);
78244 pOut->enc = encoding;
78311 pOut->enc = encoding;
78577 pOut->enc = encoding;
79724 pDest->enc = encoding;
79737 pDest->enc = encoding;
79945 pOut->enc = SQLITE_UTF8; /* In case the blob is ever converted to text */
80538 assert( pKeyInfo->enc==ENC(db) );
80637 assert( pKeyInfo->enc==ENC(db) );
80673 assert( pCx->pKeyInfo->enc==ENC(db) );
81807 pOut->enc = SQLITE_UTF8; /* In case the blob is ever cast to text */
83394 pOut->enc = SQLITE_UTF8;
83774 testcase( pName->enc==SQLITE_UTF8 );
83775 testcase( pName->enc==SQLITE_UTF16BE );
83776 testcase( pName->enc==SQLITE_UTF16LE );
88618 u8 enc = ENC(pParse->db); /* The database encoding */
88624 pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
88626 pDef = sqlite3FindFunction(pParse->db, zId, -2, enc, 0);
92402 u8 enc = ENC(db); /* The text encoding used by this database */
92414 pDef = sqlite3FindFunction(db, zId, nFarg, enc, 0);
92417 pDef = sqlite3FindFunction(db, "unknown", nFarg, enc, 0);
93685 u8 enc = ENC(pParse->db);
93695 pExpr->x.pList ? pExpr->x.pList->nExpr : 0, enc, 0);
96696 }else if( aNew->pSchema->file_format && aNew->pSchema->enc!=ENC(db) ){
98828 u8 enc = ENC(db);
98832 pColl = sqlite3FindCollSeq(db, enc, zName, initbusy);
98834 pColl = sqlite3GetCollSeq(pParse, enc, pColl, zName);
101852 static void callCollNeeded(sqlite3 *db, int enc, const char *zName){
101857 db->xCollNeeded(db->pCollNeededArg, db, enc, zExternal);
101913 u8 enc, /* The desired encoding for the collating sequence */
101922 p = sqlite3FindCollSeq(db, enc, zName, 0);
101928 callCollNeeded(db, enc, zName);
101929 p = sqlite3FindCollSeq(db, enc, zName, 0);
101994 pColl[0].enc = SQLITE_UTF8;
101996 pColl[1].enc = SQLITE_UTF16LE;
101998 pColl[2].enc = SQLITE_UTF16BE;
102035 u8 enc,
102046 assert( enc>=SQLITE_UTF8 && enc<=SQLITE_UTF16BE );
102047 if( pColl ) pColl += enc-1;
102083 u8 enc /* Desired text encoding */
102102 if( enc==(p->funcFlags & SQLITE_FUNC_ENCMASK) ){
102104 }else if( (enc & p->funcFlags & 2)!=0 ){
102179 u8 enc, /* Preferred text encoding */
102196 int score = matchQuality(p, nArg, enc);
102221 int score = matchQuality(p, nArg, enc);
102239 pBest->funcFlags = enc;
102311 p->enc = SQLITE_UTF8;
112301 u8 enc;
112316 assert( encnames[SQLITE_UTF8].enc==SQLITE_UTF8 );
112317 assert( encnames[SQLITE_UTF16LE].enc==SQLITE_UTF16LE );
112318 assert( encnames[SQLITE_UTF16BE].enc==SQLITE_UTF16BE );
112333 pEnc->enc ? pEnc->enc : SQLITE_UTF16NATIVE;
112882 pDb->pSchema->enc = ENC(db);
114533 p->enc = ENC(db);
120576 u8 enc = ENC(sqlite3VdbeDb(v));
120580 sqlite3ValueFromExpr(sqlite3VdbeDb(v), pCol->pDflt, enc,
138102 int enc,
138124 extraFlags = enc & SQLITE_DETERMINISTIC;
138125 enc &= (SQLITE_FUNC_ENCMASK|SQLITE_ANY);
138135 if( enc==SQLITE_UTF16 ){
138136 enc = SQLITE_UTF16NATIVE;
138137 }else if( enc==SQLITE_ANY ){
138148 enc = SQLITE_UTF16BE;
138151 enc = SQLITE_UTF8;
138159 p = sqlite3FindFunction(db, zFunctionName, nArg, (u8)enc, 0);
138160 if( p && (p->funcFlags & SQLITE_FUNC_ENCMASK)==enc && p->nArg==nArg ){
138171 p = sqlite3FindFunction(db, zFunctionName, nArg, (u8)enc, 1);
138201 int enc,
138207 return sqlite3_create_function_v2(db, zFunc, nArg, enc, p, xSFunc, xStep,
138215 int enc,
138240 rc = sqlite3CreateFunc(db, zFunc, nArg, enc, p, xSFunc, xStep, xFinal, pArg);
138835 u8 enc,
138849 enc2 = enc;
138878 if( (pColl->enc & ~SQLITE_UTF16_ALIGNED)==enc2 ){
138883 if( p->enc==pColl->enc ){
138898 pColl->enc = (u8)(enc2 | (enc & SQLITE_UTF16_ALIGNED));
139658 int enc,
139662 return sqlite3_create_collation_v2(db, zName, enc, pCtx, xCompare, 0);
139671 int enc,
139683 rc = createCollation(db, zName, (u8)enc, pCtx, xCompare, xDel);
139696 int enc,
139710 rc = createCollation(db, zName8, (u8)enc, pCtx, xCompare, 0);
164054 int enc; /* Optimal text encoding */
164082 db, p->zName, p->nArg, p->enc, p->pContext, p->xFunc, 0, 0
172949 u8 enc /* String encoding (0 for blobs) */
172958 sqlite3ValueSetStr(pVal, nData, (char*)aCopy, enc, sqlite3_free);
173016 u8 enc = (eType==SQLITE_TEXT ? SQLITE_UTF8 : 0);
173017 rc = sessionValueSetStr(apOut[i],&pIn->aData[pIn->iNext],nByte,enc);