亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
久久精品国产网站| 国产欧美va欧美不卡在线| 亚洲男人的天堂av| 色美美综合视频| 亚洲国产精品影院| 制服丝袜激情欧洲亚洲| 国内精品国产成人国产三级粉色 | 亚洲一区自拍偷拍| 91亚洲精品久久久蜜桃| 亚洲精品成a人| 日韩视频一区二区| 国产福利一区二区三区视频 | 日韩免费视频一区| 国产精品亚洲а∨天堂免在线| 久久久91精品国产一区二区三区| 国产精品一区二区黑丝| 亚洲情趣在线观看| 91麻豆精品国产91久久久资源速度 | 亚洲三级免费观看| 在线播放视频一区| 国产成人免费视频一区| 亚洲一区在线电影| 欧美变态tickling挠脚心| 丁香另类激情小说| 性久久久久久久| 国产色综合久久| 欧美四级电影网| 国产成人福利片| 亚洲综合区在线| 久久久国产综合精品女国产盗摄| 色一情一乱一乱一91av| 激情综合亚洲精品| 亚洲最大的成人av| 久久综合九色综合久久久精品综合| 成人av影院在线| 亚洲精品日韩综合观看成人91| 欧美性受xxxx| 中文字幕在线不卡视频| 另类综合日韩欧美亚洲| 国产精品大尺度| 日韩精品一区二区在线| 日本韩国欧美一区二区三区| 久久99久久精品| 亚洲亚洲精品在线观看| 国产视频在线观看一区二区三区 | 国产精品美女视频| 欧美久久婷婷综合色| 成人免费高清在线观看| 日本亚洲三级在线| 亚洲精品视频在线观看网站| 久久综合一区二区| 91精品国产综合久久久蜜臀粉嫩| a级高清视频欧美日韩| 黄色小说综合网站| 五月天一区二区| 亚洲品质自拍视频| 国产喷白浆一区二区三区| 91精品国产综合久久小美女| 在线看一区二区| 波多野结衣中文字幕一区二区三区| 捆绑调教一区二区三区| 亚洲在线观看免费| 亚洲欧美激情在线| 国产精品另类一区| 国产精品色呦呦| 久久久久久久久久美女| 欧美大片在线观看| 日韩欧美国产1| 日韩欧美国产午夜精品| 5月丁香婷婷综合| 欧美日本在线播放| 欧美午夜精品久久久久久孕妇| 99国产精品久| 99综合电影在线视频| 国产69精品久久777的优势| 国产一区二区在线看| 激情综合五月天| 国产一区在线看| 国产福利一区在线| 国产成人精品www牛牛影视| 国产一区二区三区在线观看免费 | 亚洲成人久久影院| 午夜电影久久久| 日本在线不卡一区| 免费成人在线播放| 精品在线亚洲视频| 国产精品一卡二| 成人的网站免费观看| 99精品国产一区二区三区不卡| 97久久超碰国产精品电影| 色综合久久99| 欧美日韩成人在线| 日韩欧美国产精品一区| 久久免费看少妇高潮| 亚洲国产精品99久久久久久久久| 国产精品视频你懂的| 亚洲欧美色图小说| 亚洲成人综合视频| 精品在线视频一区| www.一区二区| 欧美视频中文字幕| 精品久久一二三区| 国产精品初高中害羞小美女文| 国产精品久久久久7777按摩| 一个色妞综合视频在线观看| 日本少妇一区二区| 国产精品456| 一本一道综合狠狠老| 7777精品伊人久久久大香线蕉的 | 欧美精品一区男女天堂| 91精品久久久久久久99蜜桃| 在线观看免费一区| 欧美日产在线观看| 久久影院电视剧免费观看| 国产精品亲子乱子伦xxxx裸| 亚洲综合一区二区三区| 美女网站视频久久| av在线免费不卡| 日韩视频一区二区在线观看| 国产精品视频免费| 婷婷开心激情综合| 国产99精品国产| 欧美巨大另类极品videosbest| 国产婷婷色一区二区三区在线| 亚洲日本护士毛茸茸| 精品一区二区三区影院在线午夜| www.亚洲激情.com| 日韩一区二区三区四区五区六区| 国产精品另类一区| 久久99精品国产麻豆婷婷洗澡| 91在线你懂得| 久久久久9999亚洲精品| 午夜国产精品一区| 色综合天天综合在线视频| 日韩精品最新网址| 一区二区免费视频| 9色porny自拍视频一区二区| 日韩一区二区免费电影| 亚洲国产精品一区二区久久恐怖片| 国产酒店精品激情| 日韩西西人体444www| 亚洲va欧美va人人爽| 91亚洲资源网| 国产精品三级av| 国产福利一区二区三区视频| 日韩欧美一区二区久久婷婷| 亚洲午夜精品在线| 91猫先生在线| 亚洲手机成人高清视频| 国产成人av影院| 久久久一区二区三区| 蜜臀av性久久久久av蜜臀妖精| 欧美亚洲另类激情小说| 亚洲日本一区二区| 99久久夜色精品国产网站| 国产午夜精品理论片a级大结局| 日韩成人精品在线观看| 欧美视频一区二区三区四区 | 欧美日韩国产精品自在自线| 日韩毛片一二三区| av成人免费在线观看| 国产精品久久久久一区| 丁香天五香天堂综合| 中文字幕av一区二区三区高| 国产高清不卡一区二区| 久久精品这里都是精品| 国产成人午夜视频| 中文字幕av一区二区三区| 懂色av一区二区夜夜嗨| 亚洲国产精品二十页| 99久久精品情趣| 一区二区三区不卡在线观看| 日本高清不卡视频| 亚洲bt欧美bt精品| 欧美高清视频不卡网| 婷婷综合五月天| 精品欧美乱码久久久久久1区2区| 麻豆国产精品一区二区三区 | 日韩一区二区免费在线电影| 免费在线一区观看| 精品成a人在线观看| 国产成人h网站| 亚洲人成电影网站色mp4| 欧美性色综合网| 奇米一区二区三区| 久久久久久亚洲综合影院红桃 | 久久综合久久久久88| 高清av一区二区| 亚洲欧美视频一区| 538在线一区二区精品国产| 另类的小说在线视频另类成人小视频在线| 日韩一区二区影院| 国产成人av资源| 亚洲最大色网站| 精品久久人人做人人爽| 成人高清视频在线观看| 一区二区成人在线观看| 日韩欧美在线一区二区三区| 国产成人综合亚洲91猫咪| 一区二区三区四区视频精品免费 |