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

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

?? encoding.c

?? ReactOS是一些高手根據Windows XP的內核編寫出的類XP。內核實現機理和API函數調用幾乎相同。甚至可以兼容XP的程序。喜歡研究系統內核的人可以看一看。
?? C
?? 第 1 頁 / 共 5 頁
字號:
	    tmp = (unsigned char *) in;
	    c = *tmp++;
	    c = c | (((unsigned int)*tmp) << 8);
	    in++;
	}
        if ((c & 0xFC00) == 0xD800) {    /* surrogates */
	    if (in >= inend) {           /* (in > inend) shouldn't happens */
		break;
	    }
	    if (xmlLittleEndian) {
		d = *in++;
	    } else {
		tmp = (unsigned char *) in;
		d = *tmp++;
		d = d | (((unsigned int)*tmp) << 8);
		in++;
	    }
            if ((d & 0xFC00) == 0xDC00) {
                c &= 0x03FF;
                c <<= 10;
                c |= d & 0x03FF;
                c += 0x10000;
            }
            else {
		*outlen = out - outstart;
		*inlenb = processed - inb;
	        return(-2);
	    }
        }

	/* assertion: c is a single UTF-4 value */
        if (out >= outend)
	    break;
        if      (c <    0x80) {  *out++=  c;                bits= -6; }
        else if (c <   0x800) {  *out++= ((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
        else if (c < 0x10000) {  *out++= ((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
        else                  {  *out++= ((c >> 18) & 0x07) | 0xF0;  bits= 12; }
 
        for ( ; bits >= 0; bits-= 6) {
            if (out >= outend)
	        break;
            *out++= ((c >> bits) & 0x3F) | 0x80;
        }
	processed = (const unsigned char*) in;
    }
    *outlen = out - outstart;
    *inlenb = processed - inb;
    return(*outlen);
}

#ifdef LIBXML_OUTPUT_ENABLED
/**
 * UTF8ToUTF16LE:
 * @outb:  a pointer to an array of bytes to store the result
 * @outlen:  the length of @outb
 * @in:  a pointer to an array of UTF-8 chars
 * @inlen:  the length of @in
 *
 * Take a block of UTF-8 chars in and try to convert it to an UTF-16LE
 * block of chars out.
 *
 * Returns the number of bytes written, or -1 if lack of space, or -2
 *     if the transcoding failed. 
 */
static int
UTF8ToUTF16LE(unsigned char* outb, int *outlen,
            const unsigned char* in, int *inlen)
{
    unsigned short* out = (unsigned short*) outb;
    const unsigned char* processed = in;
    const unsigned char *const instart = in;
    unsigned short* outstart= out;
    unsigned short* outend;
    const unsigned char* inend= in+*inlen;
    unsigned int c, d;
    int trailing;
    unsigned char *tmp;
    unsigned short tmp1, tmp2;

    /* UTF16LE encoding has no BOM */
    if ((out == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
    if (in == NULL) {
	*outlen = 0;
	*inlen = 0;
	return(0);
    }
    outend = out + (*outlen / 2);
    while (in < inend) {
      d= *in++;
      if      (d < 0x80)  { c= d; trailing= 0; }
      else if (d < 0xC0) {
          /* trailing byte in leading position */
	  *outlen = (out - outstart) * 2;
	  *inlen = processed - instart;
	  return(-2);
      } else if (d < 0xE0)  { c= d & 0x1F; trailing= 1; }
      else if (d < 0xF0)  { c= d & 0x0F; trailing= 2; }
      else if (d < 0xF8)  { c= d & 0x07; trailing= 3; }
      else {
	/* no chance for this in UTF-16 */
	*outlen = (out - outstart) * 2;
	*inlen = processed - instart;
	return(-2);
      }

      if (inend - in < trailing) {
          break;
      } 

      for ( ; trailing; trailing--) {
          if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
	      break;
          c <<= 6;
          c |= d & 0x3F;
      }

      /* assertion: c is a single UTF-4 value */
        if (c < 0x10000) {
            if (out >= outend)
	        break;
	    if (xmlLittleEndian) {
		*out++ = c;
	    } else {
		tmp = (unsigned char *) out;
		*tmp = c ;
		*(tmp + 1) = c >> 8 ;
		out++;
	    }
        }
        else if (c < 0x110000) {
            if (out+1 >= outend)
	        break;
            c -= 0x10000;
	    if (xmlLittleEndian) {
		*out++ = 0xD800 | (c >> 10);
		*out++ = 0xDC00 | (c & 0x03FF);
	    } else {
		tmp1 = 0xD800 | (c >> 10);
		tmp = (unsigned char *) out;
		*tmp = (unsigned char) tmp1;
		*(tmp + 1) = tmp1 >> 8;
		out++;

		tmp2 = 0xDC00 | (c & 0x03FF);
		tmp = (unsigned char *) out;
		*tmp  = (unsigned char) tmp2;
		*(tmp + 1) = tmp2 >> 8;
		out++;
	    }
        }
        else
	    break;
	processed = in;
    }
    *outlen = (out - outstart) * 2;
    *inlen = processed - instart;
    return(*outlen);
}

/**
 * UTF8ToUTF16:
 * @outb:  a pointer to an array of bytes to store the result
 * @outlen:  the length of @outb
 * @in:  a pointer to an array of UTF-8 chars
 * @inlen:  the length of @in
 *
 * Take a block of UTF-8 chars in and try to convert it to an UTF-16
 * block of chars out.
 *
 * Returns the number of bytes written, or -1 if lack of space, or -2
 *     if the transcoding failed. 
 */
static int
UTF8ToUTF16(unsigned char* outb, int *outlen,
            const unsigned char* in, int *inlen)
{
    if (in == NULL) {
	/*
	 * initialization, add the Byte Order Mark for UTF-16LE
	 */
        if (*outlen >= 2) {
	    outb[0] = 0xFF;
	    outb[1] = 0xFE;
	    *outlen = 2;
	    *inlen = 0;
#ifdef DEBUG_ENCODING
            xmlGenericError(xmlGenericErrorContext,
		    "Added FFFE Byte Order Mark\n");
#endif
	    return(2);
	}
	*outlen = 0;
	*inlen = 0;
	return(0);
    }
    return (UTF8ToUTF16LE(outb, outlen, in, inlen));
}
#endif /* LIBXML_OUTPUT_ENABLED */

/**
 * UTF16BEToUTF8:
 * @out:  a pointer to an array of bytes to store the result
 * @outlen:  the length of @out
 * @inb:  a pointer to an array of UTF-16 passed as a byte array
 * @inlenb:  the length of @in in UTF-16 chars
 *
 * Take a block of UTF-16 ushorts in and try to convert it to an UTF-8
 * block of chars out. This function assumes the endian property
 * is the same between the native type of this machine and the
 * inputed one.
 *
 * Returns the number of bytes written, or -1 if lack of space, or -2
 *     if the transcoding fails (if *in is not a valid utf16 string)
 * The value of *inlen after return is the number of octets consumed
 *     if the return value is positive, else unpredictable.
 */
static int
UTF16BEToUTF8(unsigned char* out, int *outlen,
            const unsigned char* inb, int *inlenb)
{
    unsigned char* outstart = out;
    const unsigned char* processed = inb;
    unsigned char* outend = out + *outlen;
    unsigned short* in = (unsigned short*) inb;
    unsigned short* inend;
    unsigned int c, d, inlen;
    unsigned char *tmp;
    int bits;

    if ((*inlenb % 2) == 1)
        (*inlenb)--;
    inlen = *inlenb / 2;
    inend= in + inlen;
    while (in < inend) {
	if (xmlLittleEndian) {
	    tmp = (unsigned char *) in;
	    c = *tmp++;
	    c = c << 8;
	    c = c | (unsigned int) *tmp;
	    in++;
	} else {
	    c= *in++;
	} 
        if ((c & 0xFC00) == 0xD800) {    /* surrogates */
	    if (in >= inend) {           /* (in > inend) shouldn't happens */
		*outlen = out - outstart;
		*inlenb = processed - inb;
	        return(-2);
	    }
	    if (xmlLittleEndian) {
		tmp = (unsigned char *) in;
		d = *tmp++;
		d = d << 8;
		d = d | (unsigned int) *tmp;
		in++;
	    } else {
		d= *in++;
	    }
            if ((d & 0xFC00) == 0xDC00) {
                c &= 0x03FF;
                c <<= 10;
                c |= d & 0x03FF;
                c += 0x10000;
            }
            else {
		*outlen = out - outstart;
		*inlenb = processed - inb;
	        return(-2);
	    }
        }

	/* assertion: c is a single UTF-4 value */
        if (out >= outend) 
	    break;
        if      (c <    0x80) {  *out++=  c;                bits= -6; }
        else if (c <   0x800) {  *out++= ((c >>  6) & 0x1F) | 0xC0;  bits=  0; }
        else if (c < 0x10000) {  *out++= ((c >> 12) & 0x0F) | 0xE0;  bits=  6; }
        else                  {  *out++= ((c >> 18) & 0x07) | 0xF0;  bits= 12; }
 
        for ( ; bits >= 0; bits-= 6) {
            if (out >= outend) 
	        break;
            *out++= ((c >> bits) & 0x3F) | 0x80;
        }
	processed = (const unsigned char*) in;
    }
    *outlen = out - outstart;
    *inlenb = processed - inb;
    return(*outlen);
}

#ifdef LIBXML_OUTPUT_ENABLED
/**
 * UTF8ToUTF16BE:
 * @outb:  a pointer to an array of bytes to store the result
 * @outlen:  the length of @outb
 * @in:  a pointer to an array of UTF-8 chars
 * @inlen:  the length of @in
 *
 * Take a block of UTF-8 chars in and try to convert it to an UTF-16BE
 * block of chars out.
 *
 * Returns the number of byte written, or -1 by lack of space, or -2
 *     if the transcoding failed. 
 */
static int
UTF8ToUTF16BE(unsigned char* outb, int *outlen,
            const unsigned char* in, int *inlen)
{
    unsigned short* out = (unsigned short*) outb;
    const unsigned char* processed = in;
    const unsigned char *const instart = in;
    unsigned short* outstart= out;
    unsigned short* outend;
    const unsigned char* inend= in+*inlen;
    unsigned int c, d;
    int trailing;
    unsigned char *tmp;
    unsigned short tmp1, tmp2;

    /* UTF-16BE has no BOM */
    if ((outb == NULL) || (outlen == NULL) || (inlen == NULL)) return(-1);
    if (in == NULL) {
	*outlen = 0;
	*inlen = 0;
	return(0);
    }
    outend = out + (*outlen / 2);
    while (in < inend) {
      d= *in++;
      if      (d < 0x80)  { c= d; trailing= 0; }
      else if (d < 0xC0)  {
          /* trailing byte in leading position */
	  *outlen = out - outstart;
	  *inlen = processed - instart;
	  return(-2);
      } else if (d < 0xE0)  { c= d & 0x1F; trailing= 1; }
      else if (d < 0xF0)  { c= d & 0x0F; trailing= 2; }
      else if (d < 0xF8)  { c= d & 0x07; trailing= 3; }
      else {
          /* no chance for this in UTF-16 */
	  *outlen = out - outstart;
	  *inlen = processed - instart;
	  return(-2);
      }

      if (inend - in < trailing) {
          break;
      } 

      for ( ; trailing; trailing--) {
          if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))  break;
          c <<= 6;
          c |= d & 0x3F;
      }

      /* assertion: c is a single UTF-4 value */
        if (c < 0x10000) {
            if (out >= outend)  break;
	    if (xmlLittleEndian) {
		tmp = (unsigned char *) out;
		*tmp = c >> 8;
		*(tmp + 1) = c;
		out++;
	    } else {
		*out++ = c;
	    }
        }
        else if (c < 0x110000) {
            if (out+1 >= outend)  break;
            c -= 0x10000;
	    if (xmlLittleEndian) {
		tmp1 = 0xD800 | (c >> 10);
		tmp = (unsigned char *) out;
		*tmp = tmp1 >> 8;
		*(tmp + 1) = (unsigned char) tmp1;
		out++;

		tmp2 = 0xDC00 | (c & 0x03FF);
		tmp = (unsigned char *) out;
		*tmp = tmp2 >> 8;
		*(tmp + 1) = (unsigned char) tmp2;
		out++;
	    } else {
		*out++ = 0xD800 | (c >> 10);
		*out++ = 0xDC00 | (c & 0x03FF);
	    }
        }
        else
	    break;
	processed = in;
    }
    *outlen = (out - outstart) * 2;
    *inlen = processed - instart;
    return(*outlen);
}
#endif /* LIBXML_OUTPUT_ENABLED */

/************************************************************************
 *									*
 *		Generic encoding handling routines			*
 *									*
 ************************************************************************/

/**
 * xmlDetectCharEncoding:
 * @in:  a pointer to the first bytes of the XML entity, must be at least
 *       2 bytes long (at least 4 if encoding is UTF4 variant).
 * @len:  pointer to the length of the buffer
 *
 * Guess the encoding of the entity using the first bytes of the entity content
 * according to the non-normative appendix F of the XML-1.0 recommendation.
 * 
 * Returns one of the XML_CHAR_ENCODING_... values.
 */
xmlCharEncoding
xmlDetectCharEncoding(const unsigned char* in, int len)
{
    if (in == NULL) 
        return(XML_CHAR_ENCODING_NONE);
    if (len >= 4) {
	if ((in[0] == 0x00) && (in[1] == 0x00) &&
	    (in[2] == 0x00) && (in[3] == 0x3C))
	    return(XML_CHAR_ENCODING_UCS4BE);
	if ((in[0] == 0x3C) && (in[1] == 0x00) &&
	    (in[2] == 0x00) && (in[3] == 0x00))
	    return(XML_CHAR_ENCODING_UCS4LE);
	if ((in[0] == 0x00) && (in[1] == 0x00) &&
	    (in[2] == 0x3C) && (in[3] == 0x00))
	    return(XML_CHAR_ENCODING_UCS4_2143);
	if ((in[0] == 0x00) && (in[1] == 0x3C) &&
	    (in[2] == 0x00) && (in[3] == 0x00))

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩和欧美的一区| 日本高清不卡视频| 99亚偷拍自图区亚洲| 欧美日韩一级视频| 国产精品久久毛片a| 久久精品国产77777蜜臀| 91欧美激情一区二区三区成人| 日韩小视频在线观看专区| 奇米888四色在线精品| 91在线播放网址| 久久久久久久精| 麻豆精品一区二区| 精品视频一区 二区 三区| 国产精品美女久久久久aⅴ | 国产精品人人做人人爽人人添| 亚洲1区2区3区视频| av电影天堂一区二区在线观看| 久久免费的精品国产v∧| 日本va欧美va瓶| 欧美高清一级片在线| 亚洲美女精品一区| 99视频在线观看一区三区| 久久嫩草精品久久久久| 韩国成人精品a∨在线观看| 3d成人h动漫网站入口| 亚洲成人精品一区| 欧美日韩国产首页| 亚洲国产视频一区| 欧美日韩一级视频| 天天亚洲美女在线视频| 欧美日韩国产三级| 日韩激情一二三区| 日韩视频在线永久播放| 久久国产精品99久久久久久老狼| 日韩一区二区精品在线观看| 欧美aaa在线| 久久青草欧美一区二区三区| 国产在线精品一区二区三区不卡| 精品精品欲导航| 国产在线麻豆精品观看| 国产性做久久久久久| 国产激情精品久久久第一区二区| 久久精品亚洲麻豆av一区二区| 激情综合亚洲精品| 亚洲国产成人一区二区三区| 成人av资源下载| 一区二区三区精密机械公司| 欧美日韩第一区日日骚| 美女脱光内衣内裤视频久久网站| 精品久久久久久久久久久院品网| 懂色av一区二区在线播放| 中文字幕在线一区| 欧美色视频一区| 精品一区二区影视| 亚洲视频一区在线观看| 欧美色手机在线观看| 精品亚洲aⅴ乱码一区二区三区| 久久精品视频网| 在线视频国内自拍亚洲视频| 偷窥少妇高潮呻吟av久久免费| ww亚洲ww在线观看国产| aaa欧美日韩| 日韩精品成人一区二区在线| 久久久国产午夜精品| 一本色道久久综合亚洲91| 免费高清在线一区| 中文字幕一区二区三区精华液| 欧美日韩性生活| 高清国产一区二区三区| 亚洲sss视频在线视频| 亚洲柠檬福利资源导航| 欧美电视剧在线观看完整版| 丁香婷婷综合激情五月色| 亚洲一区二区在线观看视频| 精品国产乱码久久久久久久| 色999日韩国产欧美一区二区| 麻豆成人久久精品二区三区红| 中文字幕精品在线不卡| 日韩欧美一区二区视频| 91国偷自产一区二区三区成为亚洲经典 | 欧美日韩国产片| 成人高清免费观看| 美女网站色91| 日日摸夜夜添夜夜添精品视频| 国产欧美一区二区精品性色超碰| 欧美日韩国产高清一区二区三区| 成人app软件下载大全免费| 紧缚奴在线一区二区三区| 亚洲一区二区视频在线观看| 欧美国产激情一区二区三区蜜月| 777午夜精品免费视频| 91一区二区三区在线观看| 久久电影网站中文字幕| 五月天丁香久久| 亚洲精品日日夜夜| 亚洲色图欧美激情| 国产精品日日摸夜夜摸av| 欧美精品一区在线观看| 91麻豆精品国产综合久久久久久| 色婷婷亚洲精品| 色婷婷综合中文久久一本| 大尺度一区二区| 国产成人高清在线| 国产麻豆精品在线| 国产精品99久久久久久似苏梦涵| 久久草av在线| 久久99热这里只有精品| 午夜成人免费电影| 日本中文在线一区| 日韩福利电影在线| 日韩高清在线不卡| 久久精工是国产品牌吗| 日本成人在线不卡视频| 日韩电影免费一区| 青娱乐精品在线视频| 北岛玲一区二区三区四区| 高清国产一区二区| 99亚偷拍自图区亚洲| 91在线国内视频| 成人av在线电影| 色综合久久久久久久久| 99精品欧美一区二区三区小说 | 亚洲国产精品影院| 亚洲综合在线免费观看| 亚洲在线视频一区| 亚洲电影欧美电影有声小说| 亚洲高清在线视频| 男女视频一区二区| 国产毛片精品一区| 91免费精品国自产拍在线不卡| 99国产精品久久久久| 欧美午夜精品电影| 91精品国产综合久久精品图片 | 9久草视频在线视频精品| 99久久国产综合色|国产精品| 91国产丝袜在线播放| 欧美日韩国产在线观看| 欧美成人aa大片| 国产精品日日摸夜夜摸av| 亚洲自拍欧美精品| 久久69国产一区二区蜜臀| 岛国精品在线观看| 欧美午夜电影网| 久久亚洲一级片| 亚洲电影一区二区| 国产成人午夜精品影院观看视频 | 日韩精品一区二区三区视频| 国产拍揄自揄精品视频麻豆| 亚洲免费电影在线| 麻豆精品一二三| 色综合视频在线观看| 欧美一区二区三区成人| 国产日韩欧美综合一区| 亚洲国产欧美一区二区三区丁香婷| 国产乱人伦偷精品视频不卡| 色噜噜偷拍精品综合在线| 日韩小视频在线观看专区| 亚洲精品乱码久久久久久黑人| 久久精品国产在热久久| 99国产精品久久久久久久久久久| 日本一区二区三区高清不卡| 五月天一区二区三区| 成人黄色在线视频| 精品欧美黑人一区二区三区| 亚洲欧洲国产日本综合| 久99久精品视频免费观看| 在线日韩av片| 国产精品女主播av| 经典一区二区三区| 在线播放中文一区| 亚洲欧美激情小说另类| 国产精品一区在线观看乱码| 欧美一级在线视频| 亚洲国产毛片aaaaa无费看| eeuss鲁片一区二区三区在线看| 欧美精品一区二区三区很污很色的| 亚洲午夜久久久久久久久久久| 成人性生交大片免费看视频在线| 日韩视频不卡中文| 五月开心婷婷久久| 欧美性大战久久久久久久| 亚洲欧美日韩在线| k8久久久一区二区三区| 久久综合五月天婷婷伊人| 麻豆精品久久久| 日韩色视频在线观看| 亚洲国产精品久久一线不卡| 91视频在线看| 中文字幕一区二区三区乱码在线| 成人自拍视频在线观看| 国产无人区一区二区三区| 国产精品99久| 国产精品少妇自拍| 91在线看国产| 洋洋成人永久网站入口| 欧美亚洲自拍偷拍| 午夜电影网一区| 日韩一级片网址| 久久99精品国产麻豆不卡| 久久久亚洲高清|