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

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

?? encoding.c.svn-base

?? 這是一個用于解析xml文件的類庫。使用這個類庫
?? SVN-BASE
?? 第 1 頁 / 共 5 頁
字號:
/* * encoding.c : implements the encoding conversion functions needed for XML * * Related specs:  * rfc2044        (UTF-8 and UTF-16) F. Yergeau Alis Technologies * rfc2781        UTF-16, an encoding of ISO 10646, P. Hoffman, F. Yergeau * [ISO-10646]    UTF-8 and UTF-16 in Annexes * [ISO-8859-1]   ISO Latin-1 characters codes. * [UNICODE]      The Unicode Consortium, "The Unicode Standard -- *                Worldwide Character Encoding -- Version 1.0", Addison- *                Wesley, Volume 1, 1991, Volume 2, 1992.  UTF-8 is *                described in Unicode Technical Report #4. * [US-ASCII]     Coded Character Set--7-bit American Standard Code for *                Information Interchange, ANSI X3.4-1986. * * See Copyright for the status of this software. * * daniel@veillard.com * * Original code for IsoLatin1 and UTF-16 by "Martin J. Duerst" <duerst@w3.org> */#define IN_LIBXML#include "libxml.h"#include <string.h>#ifdef HAVE_CTYPE_H#include <ctype.h>#endif#ifdef HAVE_STDLIB_H#include <stdlib.h>#endif#ifdef LIBXML_ICONV_ENABLED#ifdef HAVE_ERRNO_H#include <errno.h>#endif#endif#include <libxml/encoding.h>#include <libxml/xmlmemory.h>#ifdef LIBXML_HTML_ENABLED#include <libxml/HTMLparser.h>#endif#include <libxml/globals.h>#include <libxml/xmlerror.h>static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL;static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL;typedef struct _xmlCharEncodingAlias xmlCharEncodingAlias;typedef xmlCharEncodingAlias *xmlCharEncodingAliasPtr;struct _xmlCharEncodingAlias {    const char *name;    const char *alias;};static xmlCharEncodingAliasPtr xmlCharEncodingAliases = NULL;static int xmlCharEncodingAliasesNb = 0;static int xmlCharEncodingAliasesMax = 0;#ifdef LIBXML_ICONV_ENABLED#if 0#define DEBUG_ENCODING  /* Define this to get encoding traces */#endif#else#ifdef LIBXML_ISO8859X_ENABLEDstatic void xmlRegisterCharEncodingHandlersISO8859x (void);#endif#endifstatic int xmlLittleEndian = 1;/************************************************************************ *									* *		Conversions To/From UTF8 encoding			* *									* ************************************************************************//** * asciiToUTF8: * @out:  a pointer to an array of bytes to store the result * @outlen:  the length of @out * @in:  a pointer to an array of ASCII chars * @inlen:  the length of @in * * Take a block of ASCII chars in and try to convert it to an UTF-8 * block of chars out. * Returns 0 if success, or -1 otherwise * The value of @inlen after return is the number of octets consumed *     if the return value is positive, else unpredictable. * The value of @outlen after return is the number of octets consumed. */static intasciiToUTF8(unsigned char* out, int *outlen,              const unsigned char* in, int *inlen) {    unsigned char* outstart = out;    const unsigned char* base = in;    const unsigned char* processed = in;    unsigned char* outend = out + *outlen;    const unsigned char* inend;    unsigned int c;    int bits;    inend = in + (*inlen);    while ((in < inend) && (out - outstart + 5 < *outlen)) {	c= *in++;	/* assertion: c is a single UTF-4 value */        if (out >= outend)	    break;        if      (c <    0x80) {  *out++=  c;                bits= -6; }        else { 	    *outlen = out - outstart;	    *inlen = processed - base;	    return(-1);	}         for ( ; bits >= 0; bits-= 6) {            if (out >= outend)	        break;            *out++= ((c >> bits) & 0x3F) | 0x80;        }	processed = (const unsigned char*) in;    }    *outlen = out - outstart;    *inlen = processed - base;    return(0);}#ifdef LIBXML_OUTPUT_ENABLED/** * UTF8Toascii: * @out:  a pointer to an array of bytes to store the result * @outlen:  the length of @out * @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 ASCII * block of chars out. * * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise * The value of @inlen after return is the number of octets consumed *     if the return value is positive, else unpredictable. * The value of @outlen after return is the number of octets consumed. */static intUTF8Toascii(unsigned char* out, int *outlen,              const unsigned char* in, int *inlen) {    const unsigned char* processed = in;    const unsigned char* outend;    const unsigned char* outstart = out;    const unsigned char* instart = in;    const unsigned char* inend;    unsigned int c, d;    int trailing;    if (in == NULL) {        /*	 * initialization nothing to do	 */	*outlen = 0;	*inlen = 0;	return(0);    }    inend = in + (*inlen);    outend = out + (*outlen);    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 Ascii */	    *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 < 0x80) {	    if (out >= outend)		break;	    *out++ = c;	} else {	    /* no chance for this in Ascii */	    *outlen = out - outstart;	    *inlen = processed - instart;	    return(-2);	}	processed = in;    }    *outlen = out - outstart;    *inlen = processed - instart;    return(0);}#endif /* LIBXML_OUTPUT_ENABLED *//** * isolat1ToUTF8: * @out:  a pointer to an array of bytes to store the result * @outlen:  the length of @out * @in:  a pointer to an array of ISO Latin 1 chars * @inlen:  the length of @in * * Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8 * block of chars out. * Returns 0 if success, or -1 otherwise * The value of @inlen after return is the number of octets consumed *     if the return value is positive, else unpredictable. * The value of @outlen after return is the number of octets consumed. */intisolat1ToUTF8(unsigned char* out, int *outlen,              const unsigned char* in, int *inlen) {    unsigned char* outstart = out;    const unsigned char* base = in;    unsigned char* outend = out + *outlen;    const unsigned char* inend;    const unsigned char* instop;    inend = in + (*inlen);    instop = inend;        while (in < inend && out < outend - 1) {    	if (*in >= 0x80) {	    *out++ = (((*in) >>  6) & 0x1F) | 0xC0;        *out++ = ((*in) & 0x3F) | 0x80;	    ++in;	}	if (instop - in > outend - out) instop = in + (outend - out); 	while (in < instop && *in < 0x80) {	    *out++ = *in++;	}    }	    if (in < inend && out < outend && *in < 0x80) {        *out++ = *in++;    }    *outlen = out - outstart;    *inlen = in - base;    return(0);}/** * UTF8ToUTF8: * @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-8 chars * @inlenb:  the length of @in in UTF-8 chars * * No op copy operation for UTF8 handling. * * Returns the number of bytes written, or -1 if lack of space. *     The value of *inlen after return is the number of octets consumed *     if the return value is positive, else unpredictable. */static intUTF8ToUTF8(unsigned char* out, int *outlen,           const unsigned char* inb, int *inlenb){    int len;    if ((out == NULL) || (inb == NULL) || (outlen == NULL) || (inlenb == NULL))	return(-1);    if (*outlen > *inlenb) {	len = *inlenb;    } else {	len = *outlen;    }    if (len < 0)	return(-1);    memcpy(out, inb, len);    *outlen = len;    *inlenb = len;    return(0);}#ifdef LIBXML_OUTPUT_ENABLED/** * UTF8Toisolat1: * @out:  a pointer to an array of bytes to store the result * @outlen:  the length of @out * @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 ISO Latin 1 * block of chars out. * * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise * The value of @inlen after return is the number of octets consumed *     if the return value is positive, else unpredictable. * The value of @outlen after return is the number of octets consumed. */intUTF8Toisolat1(unsigned char* out, int *outlen,              const unsigned char* in, int *inlen) {    const unsigned char* processed = in;    const unsigned char* outend;    const unsigned char* outstart = out;    const unsigned char* instart = in;    const unsigned char* inend;    unsigned int c, d;    int trailing;    if (in == NULL) {        /*	 * initialization nothing to do	 */	*outlen = 0;	*inlen = 0;	return(0);    }    inend = in + (*inlen);    outend = out + (*outlen);    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 IsoLat1 */	    *outlen = out - outstart;	    *inlen = processed - instart;	    return(-2);	}	if (inend - in < trailing) {	    break;	} 	for ( ; trailing; trailing--) {	    if (in >= inend)		break;	    if (((d= *in++) & 0xC0) != 0x80) {		*outlen = out - outstart;		*inlen = processed - instart;		return(-2);	    }	    c <<= 6;	    c |= d & 0x3F;	}	/* assertion: c is a single UTF-4 value */	if (c <= 0xFF) {	    if (out >= outend)		break;	    *out++ = c;	} else {	    /* no chance for this in IsoLat1 */	    *outlen = out - outstart;	    *inlen = processed - instart;	    return(-2);	}	processed = in;    }    *outlen = out - outstart;    *inlen = processed - instart;    return(0);}#endif /* LIBXML_OUTPUT_ENABLED *//** * UTF16LEToUTF8: * @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-16LE passwd as a byte array * @inlenb:  the length of @in in UTF-16LE chars * * Take a block of UTF-16LE 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 intUTF16LEToUTF8(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) && (out - outstart + 5 < *outlen)) {        if (xmlLittleEndian) {	    c= *in++;	} else {	    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 {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲.国产.中文慕字在线| 精品综合久久久久久8888| 天堂av在线一区| 国产剧情一区二区| 欧美日韩午夜在线视频| 国产欧美视频一区二区| 亚洲国产综合人成综合网站| 国产精品一品二品| 日韩欧美精品在线视频| 亚洲欧美电影一区二区| 国产露脸91国语对白| 欧美精品xxxxbbbb| 亚洲人妖av一区二区| 国产一区二区在线视频| 欧美高清你懂得| 亚洲精品大片www| 成人毛片老司机大片| 久久人人爽人人爽| 日韩精品亚洲一区二区三区免费| 99国产精品久久久久久久久久久 | 另类中文字幕网| 色综合久久88色综合天天| 中文无字幕一区二区三区| 久久国产精品色婷婷| 欧美精品日韩一区| 日韩1区2区3区| 欧美一级日韩不卡播放免费| 亚洲不卡在线观看| 欧美性xxxxxxxx| 一区二区理论电影在线观看| 色综合久久久久综合99| 亚洲三级免费观看| 91成人看片片| 亚洲综合久久久| 欧美视频第二页| 亚洲成人精品一区二区| 欧美精品一二三| 美女视频网站久久| 欧美xxxxxxxx| 国产乱人伦精品一区二区在线观看| 精品乱码亚洲一区二区不卡| 韩国女主播成人在线观看| 久久综合五月天婷婷伊人| 国产呦精品一区二区三区网站| xnxx国产精品| 不卡视频免费播放| 亚洲欧美一区二区不卡| 在线中文字幕不卡| 日本欧美一区二区在线观看| 日韩免费看网站| 国产91精品欧美| 亚洲视频一区二区在线观看| 欧洲视频一区二区| 美国av一区二区| 国产亚洲欧美色| 91在线免费看| 午夜精品久久久| xnxx国产精品| 色婷婷综合久久久中文字幕| 亚洲午夜久久久| 欧美变态tickling挠脚心| 丰满亚洲少妇av| 亚洲精品乱码久久久久久久久| 欧美日韩一区国产| 国产一区二区看久久| 亚洲精品视频观看| 精品久久一区二区三区| 不卡视频在线观看| 日韩综合小视频| xnxx国产精品| 欧美日韩一区二区在线视频| 国产一区二区毛片| 亚洲一区二区三区国产| 欧美va亚洲va在线观看蝴蝶网| 国产精品毛片a∨一区二区三区| 欧美最猛性xxxxx直播| 美女视频黄久久| 有坂深雪av一区二区精品| 日韩欧美专区在线| 91麻豆产精品久久久久久| 免播放器亚洲一区| 在线观看日韩高清av| 精品综合免费视频观看| 亚洲欧美激情插 | 美女视频一区二区| 亚洲欧洲性图库| 精品国产欧美一区二区| 日本乱人伦一区| 国产精品影视网| 日韩黄色片在线观看| 亚洲欧美日韩中文字幕一区二区三区| 欧美一区二区在线免费播放| 99久久精品免费观看| 国产一区在线看| 蜜臀91精品一区二区三区| 亚洲精品免费电影| 久久精品男人天堂av| 欧美成人精品高清在线播放| 在线看一区二区| 成人18精品视频| 国产一区91精品张津瑜| 捆绑变态av一区二区三区| 亚洲小说春色综合另类电影| 国产精品美女www爽爽爽| 国产日韩欧美精品综合| 欧美成人在线直播| 欧美电影免费观看高清完整版在线 | 东方欧美亚洲色图在线| 日韩中文字幕不卡| 爽好多水快深点欧美视频| 综合久久久久久| 日韩码欧中文字| 国产精品每日更新| 中文字幕日韩一区| 国产欧美一区二区三区网站 | 国精产品一区一区三区mba桃花| 欧美片网站yy| 欧美无砖砖区免费| 在线观看成人免费视频| 91福利视频久久久久| 欧洲一区二区三区免费视频| 欧美性色欧美a在线播放| 91国产成人在线| 欧美色图在线观看| 欧美高清性hdvideosex| 欧美成人午夜电影| 久久天天做天天爱综合色| 久久久久久久久久久久久夜| 国产视频一区不卡| 国产精品国模大尺度视频| 一本到不卡精品视频在线观看| 91美女视频网站| 欧美色图片你懂的| 日韩网站在线看片你懂的| 精品少妇一区二区三区日产乱码 | 欧美三区在线观看| 91精品国产高清一区二区三区| 欧美一区二区三区免费大片| 精品久久一区二区三区| 国产精品久久久久久久久搜平片 | 亚洲国产视频直播| 日韩精品一区二区三区中文不卡| 欧美精品一区二区三区一线天视频 | 中文字幕一区二区三区视频| 日韩一区欧美小说| 天天影视网天天综合色在线播放| 麻豆视频观看网址久久| 国产成人免费9x9x人网站视频| 99久久国产综合色|国产精品| 欧美三级电影网站| 精品国产三级a在线观看| **网站欧美大片在线观看| 日韩欧美国产综合一区| 国产午夜精品一区二区| 亚洲综合在线免费观看| 经典三级在线一区| 色噜噜偷拍精品综合在线| 精品剧情在线观看| 一区二区三区国产豹纹内裤在线 | 成人黄色在线看| 欧美精品一级二级| 国产精品国产精品国产专区不片| 午夜国产不卡在线观看视频| 国产成人aaa| 91精品国产手机| 在线观看日韩毛片| 国产欧美一区视频| 日韩va亚洲va欧美va久久| 91蜜桃在线免费视频| 欧美成人国产一区二区| 亚洲激情在线播放| 丁香五精品蜜臀久久久久99网站| 日韩一区二区免费视频| 亚洲欧美另类小说| 国产乱对白刺激视频不卡| 欧美一区国产二区| 亚洲国产成人av好男人在线观看| 国产成人高清视频| 精品日韩在线观看| 免费看欧美女人艹b| 91福利视频在线| 亚洲欧美色图小说| 亚洲免费在线视频一区 二区| 国产毛片精品一区| 日韩欧美在线影院| 日韩精品乱码免费| 欧美日韩精品一区二区三区蜜桃| 一区二区三区在线影院| 97精品视频在线观看自产线路二| 2023国产精品自拍| 国内精品视频666| 欧美不卡一区二区| 久久国产欧美日韩精品| 日韩一区二区高清| 免费视频最近日韩| 69久久夜色精品国产69蝌蚪网| 亚洲主播在线观看| 欧美视频在线观看一区二区| 亚洲精选一二三| 91久久国产最好的精华液|