亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? utf.c

?? sqlite 3.3.8 支持加密的版本
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
** 2004 April 13
**
** The author disclaims copyright to this source code.  In place of
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** This file contains routines used to translate between UTF-8, 
** UTF-16, UTF-16BE, and UTF-16LE.
**
** $Id: utf.c,v 1.23 2006/10/12 21:34:22 rmsimpson Exp $
**
** Notes on UTF-8:
**
**   Byte-0    Byte-1    Byte-2    Byte-3    Value
**  0xxxxxxx                                 00000000 00000000 0xxxxxxx
**  110yyyyy  10xxxxxx                       00000000 00000yyy yyxxxxxx
**  1110zzzz  10yyyyyy  10xxxxxx             00000000 zzzzyyyy yyxxxxxx
**  11110uuu  10uuzzzz  10yyyyyy  10xxxxxx   000uuuuu zzzzyyyy yyxxxxxx
**
**
** Notes on UTF-16:  (with wwww+1==uuuuu)
**
**      Word-0               Word-1          Value
**  110110ww wwzzzzyy   110111yy yyxxxxxx    000uuuuu zzzzyyyy yyxxxxxx
**  zzzzyyyy yyxxxxxx                        00000000 zzzzyyyy yyxxxxxx
**
**
** BOM or Byte Order Mark:
**     0xff 0xfe   little-endian utf-16 follows
**     0xfe 0xff   big-endian utf-16 follows
**
**
** Handling of malformed strings:
**
** SQLite accepts and processes malformed strings without an error wherever
** possible. However this is not possible when converting between UTF-8 and
** UTF-16.
**
** When converting malformed UTF-8 strings to UTF-16, one instance of the
** replacement character U+FFFD for each byte that cannot be interpeted as
** part of a valid unicode character.
**
** When converting malformed UTF-16 strings to UTF-8, one instance of the
** replacement character U+FFFD for each pair of bytes that cannot be
** interpeted as part of a valid unicode character.
**
** This file contains the following public routines:
**
** sqlite3VdbeMemTranslate() - Translate the encoding used by a Mem* string.
** sqlite3VdbeMemHandleBom() - Handle byte-order-marks in UTF16 Mem* strings.
** sqlite3utf16ByteLen()     - Calculate byte-length of a void* UTF16 string.
** sqlite3utf8CharLen()      - Calculate char-length of a char* UTF8 string.
** sqlite3utf8LikeCompare()  - Do a LIKE match given two UTF8 char* strings.
**
*/
#include "sqliteInt.h"
#include <assert.h>
#include "vdbeInt.h"

/*
** This table maps from the first byte of a UTF-8 character to the number
** of trailing bytes expected. A value '255' indicates that the table key
** is not a legal first byte for a UTF-8 character.
*/
static const u8 xtra_utf8_bytes[256]  = {
/* 0xxxxxxx */
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,     0, 0, 0, 0, 0, 0, 0, 0,

/* 10wwwwww */
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,

/* 110yyyyy */
1, 1, 1, 1, 1, 1, 1, 1,     1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1,     1, 1, 1, 1, 1, 1, 1, 1,

/* 1110zzzz */
2, 2, 2, 2, 2, 2, 2, 2,     2, 2, 2, 2, 2, 2, 2, 2,

/* 11110yyy */
3, 3, 3, 3, 3, 3, 3, 3,     255, 255, 255, 255, 255, 255, 255, 255,
};

/*
** This table maps from the number of trailing bytes in a UTF-8 character
** to an integer constant that is effectively calculated for each character
** read by a naive implementation of a UTF-8 character reader. The code
** in the READ_UTF8 macro explains things best.
*/
static const int xtra_utf8_bits[4] =  {
0,
12416,          /* (0xC0 << 6) + (0x80) */
925824,         /* (0xE0 << 12) + (0x80 << 6) + (0x80) */
63447168        /* (0xF0 << 18) + (0x80 << 12) + (0x80 << 6) + 0x80 */
};

#define READ_UTF8(zIn, c) { \
  int xtra;                                            \
  c = *(zIn)++;                                        \
  xtra = xtra_utf8_bytes[c];                           \
  switch( xtra ){                                      \
    case 255: c = (int)0xFFFD; break;                  \
    case 3: c = (c<<6) + *(zIn)++;                     \
    case 2: c = (c<<6) + *(zIn)++;                     \
    case 1: c = (c<<6) + *(zIn)++;                     \
    c -= xtra_utf8_bits[xtra];                         \
  }                                                    \
}
int sqlite3ReadUtf8(const unsigned char *z){
  int c;
  READ_UTF8(z, c);
  return c;
}

#define SKIP_UTF8(zIn) {                               \
  zIn += (xtra_utf8_bytes[*(u8 *)zIn] + 1);            \
}

#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);                       \
  }                                                    \
}

#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));                         \
  }                                                             \
}

#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);                                       \
  }                                                             \
}

#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);   \
  }                                                                   \
}

#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);   \
  }                                                                   \
}

#define SKIP_UTF16BE(zIn){                                            \
  if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn+1)==0x00)) ){  \
    zIn += 4;                                                         \
  }else{                                                              \
    zIn += 2;                                                         \
  }                                                                   \
}
#define SKIP_UTF16LE(zIn){                                            \
  zIn++;                                                              \
  if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn-1)==0x00)) ){  \
    zIn += 3;                                                         \
  }else{                                                              \
    zIn += 1;                                                         \
  }                                                                   \
}

#define RSKIP_UTF16LE(zIn){                                            \
  if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn-1)==0x00)) ){  \
    zIn -= 4;                                                         \
  }else{                                                              \
    zIn -= 2;                                                         \
  }                                                                   \
}
#define RSKIP_UTF16BE(zIn){                                            \
  zIn--;                                                              \
  if( *zIn>=0xD8 && (*zIn<0xE0 || (*zIn==0xE0 && *(zIn+1)==0x00)) ){  \
    zIn -= 3;                                                         \
  }else{                                                              \
    zIn -= 1;                                                         \
  }                                                                   \
}

/*
** If the TRANSLATE_TRACE macro is defined, the value of each Mem is
** printed on stderr on the way into and out of sqlite3VdbeMemTranslate().
*/ 
/* #define TRANSLATE_TRACE 1 */

#ifndef SQLITE_OMIT_UTF16
/*
** This routine transforms the internal text encoding used by pMem to
** desiredEnc. It is an error if the string is already of the desired
** encoding, or if *pMem does not contain a string value.
*/
int sqlite3VdbeMemTranslate(Mem *pMem, u8 desiredEnc){
  unsigned char zShort[NBFS]; /* Temporary short output buffer */
  int len;                    /* Maximum length of output string in bytes */
  unsigned char *zOut;                  /* Output buffer */
  unsigned char *zIn;                   /* Input iterator */
  unsigned char *zTerm;                 /* End of input */
  unsigned char *z;                     /* Output iterator */
  unsigned int c;

  assert( pMem->flags&MEM_Str );
  assert( pMem->enc!=desiredEnc );
  assert( pMem->enc!=0 );
  assert( pMem->n>=0 );

#if defined(TRANSLATE_TRACE) && defined(SQLITE_DEBUG)
  {
    char zBuf[100];
    sqlite3VdbeMemPrettyPrint(pMem, zBuf);
    fprintf(stderr, "INPUT:  %s\n", zBuf);
  }
#endif

  /* If the translation is between UTF-16 little and big endian, then 
  ** all that is required is to swap the byte order. This case is handled
  ** differently from the others.
  */
  if( pMem->enc!=SQLITE_UTF8 && desiredEnc!=SQLITE_UTF8 ){
    u8 temp;
    int rc;
    rc = sqlite3VdbeMemMakeWriteable(pMem);
    if( rc!=SQLITE_OK ){
      assert( rc==SQLITE_NOMEM );
      return SQLITE_NOMEM;
    }
    zIn = (u8*)pMem->z;
    zTerm = &zIn[pMem->n];
    while( zIn<zTerm ){
      temp = *zIn;
      *zIn = *(zIn+1);
      zIn++;
      *zIn++ = temp;
    }
    pMem->enc = desiredEnc;
    goto translate_out;
  }

  /* Set len to the maximum number of bytes required in the output buffer. */
  if( desiredEnc==SQLITE_UTF8 ){
    /* When converting from UTF-16, the maximum growth results from
    ** translating a 2-byte character to a 4-byte UTF-8 character.
    ** A single byte is required for the output string
    ** nul-terminator.
    */
    len = pMem->n * 2 + 1;
  }else{
    /* When converting from UTF-8 to UTF-16 the maximum growth is caused
    ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16
    ** character. Two bytes are required in the output buffer for the
    ** nul-terminator.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91女人视频在线观看| 亚洲男人的天堂在线观看| 亚洲成人激情av| 欧美性受xxxx| 亚洲综合丝袜美腿| 欧美性猛交xxxx乱大交退制版| 亚洲精品亚洲人成人网在线播放| 日本丶国产丶欧美色综合| 亚洲精品伦理在线| 欧美三级乱人伦电影| 免费人成黄页网站在线一区二区 | 无码av免费一区二区三区试看| 欧美午夜一区二区三区 | 中文字幕日韩精品一区| a亚洲天堂av| 亚洲制服丝袜一区| 精品国产一区二区三区久久影院| 国产一区二区91| 亚洲欧美一区二区久久| 国产欧美一区二区三区沐欲| 国产精品久久久久久福利一牛影视 | 日韩电影一区二区三区四区| 国产喷白浆一区二区三区| 成人av免费网站| 久久综合狠狠综合久久激情| 午夜精品久久久久久久蜜桃app| 精品一区二区免费| 99精品视频一区二区三区| 亚洲欧洲综合另类在线| 2023国产精品| 视频一区中文字幕国产| 天天综合网天天综合色| 亚洲色图第一区| 日本一区二区成人| 亚洲欧美怡红院| 欧美性xxxxxx少妇| 欧美va亚洲va在线观看蝴蝶网| 中文字幕一区免费在线观看 | 麻豆久久久久久久| 欧美视频自拍偷拍| 亚洲人成人一区二区在线观看| 大桥未久av一区二区三区中文| 中文欧美字幕免费| 亚洲女与黑人做爰| 91色视频在线| 一区二区三区四区精品在线视频| 久久国产剧场电影| 欧美人体做爰大胆视频| 中文字幕免费观看一区| 精品在线视频一区| 99精品久久只有精品| 亚洲欧洲国产日韩| 成人高清免费观看| 日韩精品专区在线影院重磅| 国产精品免费久久| 国产精品99久久久久久久vr| 欧美视频精品在线| 成人欧美一区二区三区小说| 国产黄色精品网站| 日韩一区二区免费高清| 国产精品美女久久久久久久 | 欧美精品一区二区三区很污很色的| 国产日韩欧美不卡| 国内成人精品2018免费看| 久久久久久黄色| 精品一区二区三区久久久| 欧美视频一区二区三区| a级高清视频欧美日韩| 五月婷婷综合激情| 日日噜噜夜夜狠狠视频欧美人| 色婷婷av一区二区三区之一色屋| 国产91精品免费| 麻豆国产精品一区二区三区 | 欧美日韩免费高清一区色橹橹| 懂色av一区二区在线播放| 国产一区二区影院| 裸体一区二区三区| 奇米四色…亚洲| 日日夜夜精品免费视频| 午夜精品福利视频网站| 亚洲h精品动漫在线观看| 亚洲影视资源网| 一片黄亚洲嫩模| 亚洲一区二区视频| 亚洲国产一区视频| 性做久久久久久久久| 日韩精品五月天| 免费在线观看视频一区| 久久99精品网久久| 精彩视频一区二区三区| 国产在线不卡视频| 国产福利精品一区| 99久久国产综合精品色伊| 一本高清dvd不卡在线观看| 在线观看免费成人| 制服丝袜亚洲精品中文字幕| 日韩欧美激情四射| 日本一区二区三区四区在线视频| 国产精品高潮呻吟久久| 亚洲欧美日韩电影| 亚洲成人综合视频| 看电影不卡的网站| 播五月开心婷婷综合| 不卡视频一二三四| 色老汉av一区二区三区| 欧美视频一区二| 精品国产一区二区亚洲人成毛片| 国产日本欧洲亚洲| 一区二区三区在线视频观看| 日韩精品国产精品| 国产乱人伦精品一区二区在线观看 | 精品一区二区三区在线播放| 国产精品一区二区久激情瑜伽| 99精品视频在线观看| 欧美精品tushy高清| 精品国产制服丝袜高跟| 亚洲欧美另类综合偷拍| 日本不卡123| 岛国一区二区三区| 欧美日本一道本在线视频| 久久久亚洲午夜电影| 一区二区三区四区在线免费观看| 美脚の诱脚舐め脚责91| aaa国产一区| 欧美一区二区久久久| 国产精品国产三级国产普通话三级 | 国产精品资源在线| 欧洲日韩一区二区三区| 2023国产精品| 亚洲永久免费av| 国产精品一级二级三级| 在线一区二区三区| 国产婷婷一区二区| 首页综合国产亚洲丝袜| 成人av动漫在线| 精品国产不卡一区二区三区| 亚洲综合色噜噜狠狠| 国产suv一区二区三区88区| 欧美人与性动xxxx| 亚洲精品久久嫩草网站秘色| 国产精品一区二区黑丝| 91麻豆精品国产91久久久使用方法 | 一区二区三区欧美久久| 国产99久久久国产精品| 欧美一级日韩不卡播放免费| 一区二区三区在线免费| 成人国产在线观看| 精品国产91洋老外米糕| 日韩在线播放一区二区| 欧美在线高清视频| 国产精品久久看| 国产精品影视网| 日韩你懂的在线观看| 五月天精品一区二区三区| 91行情网站电视在线观看高清版| 国产精品欧美一区喷水| 国产黄人亚洲片| 国产喂奶挤奶一区二区三区| 久久精品久久综合| 欧美成人精品1314www| 亚洲成人综合视频| 欧美日韩综合在线免费观看| 亚洲在线一区二区三区| 色94色欧美sute亚洲线路一ni| 国产精品国产三级国产aⅴ无密码 国产精品国产三级国产aⅴ原创 | 99国产精品久久久久久久久久 | 日本不卡的三区四区五区| 欧美日本在线一区| 亚洲国产一区在线观看| 在线观看日韩毛片| 亚洲精品成人少妇| 在线免费亚洲电影| 久久av资源网| 26uuu色噜噜精品一区| 久久电影网站中文字幕| 欧美www视频| 国产一区二区三区免费看 | 91精品在线一区二区| 亚洲福利一区二区| 欧美高清hd18日本| 久久综合综合久久综合| 久久久精品免费网站| 成人永久免费视频| 亚洲丝袜另类动漫二区| 色悠悠亚洲一区二区| 亚洲一二三四区| 91精品国产综合久久精品| 美国一区二区三区在线播放| 亚洲精品一区二区三区99| 国产成人在线观看| 亚洲日穴在线视频| 欧美三级电影一区| 奇米色777欧美一区二区| 久久综合精品国产一区二区三区| bt欧美亚洲午夜电影天堂| 亚洲国产wwwccc36天堂| 欧美成人video| 国产成人免费视频网站高清观看视频| 中文字幕在线不卡一区| 在线免费av一区|