1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Optimisation for unicode encoding conversion routines. (CVS 1614)

FossilOrigin-Name: 39a415eaa65964742e40b7ea4d471fa04007c6c9
This commit is contained in:
danielk1977
2004-06-18 04:24:54 +00:00
parent a285422922
commit bfd6cce56b
15 changed files with 674 additions and 1027 deletions

View File

@@ -518,20 +518,7 @@ int sqlite3_bind_text16(
}
pVar = &p->apVar[i-1];
/* There may or may not be a byte order mark at the start of the UTF-16.
** Either way set 'txt_enc' to the SQLITE_UTF16* value indicating the
** actual byte order used by this string. If the string does happen
** to contain a BOM, then move zData so that it points to the first
** byte after the BOM.
*/
txt_enc = sqlite3UtfReadBom(zData, nData);
if( txt_enc ){
zData = (void *)(((u8 *)zData) + 2);
nData -= 2;
}else{
txt_enc = SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE;
}
rc = sqlite3VdbeMemSetStr(pVar, zData, nData, txt_enc, xDel);
rc = sqlite3VdbeMemSetStr(pVar, zData, nData, SQLITE_UTF16NATIVE, xDel);
if( rc ){
return rc;
}