Lines Matching refs:in
7 * [ISO-10646] UTF-8 and UTF-16 in Annexes
12 * described in Unicode Technical Report #4.
166 * @in: a pointer to an array of ASCII chars
167 * @inlen: the length of @in
169 * Take a block of ASCII chars in and try to convert it to an UTF-8
178 const unsigned char* in, int *inlen) {
180 const unsigned char* base = in;
181 const unsigned char* processed = in;
186 inend = in + (*inlen);
187 while ((in < inend) && (out - outstart + 5 < *outlen)) {
188 c= *in++;
200 processed = (const unsigned char*) in;
212 * @in: a pointer to an array of UTF-8 chars
213 * @inlen: the length of @in
215 * Take a block of UTF-8 chars in and try to convert it to an ASCII
225 const unsigned char* in, int *inlen) {
226 const unsigned char* processed = in;
229 const unsigned char* instart = in;
235 if (in == NULL) {
243 inend = in + (*inlen);
245 while (in < inend) {
246 d = *in++;
249 /* trailing byte in leading position */
257 /* no chance for this in Ascii */
263 if (inend - in < trailing) {
268 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
280 /* no chance for this in Ascii */
285 processed = in;
297 * @in: a pointer to an array of ISO Latin 1 chars
298 * @inlen: the length of @in
300 * Take a block of ISO Latin 1 chars in and try to convert it to an UTF-8
309 const unsigned char* in, int *inlen) {
311 const unsigned char* base = in;
316 if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
320 inend = in + (*inlen);
323 while ((in < inend) && (out < outend - 1)) {
324 if (*in >= 0x80) {
325 *out++ = (((*in) >> 6) & 0x1F) | 0xC0;
326 *out++ = ((*in) & 0x3F) | 0x80;
327 ++in;
329 if ((instop - in) > (outend - out)) instop = in + (outend - out);
330 while ((in < instop) && (*in < 0x80)) {
331 *out++ = *in++;
334 if ((in < inend) && (out < outend) && (*in < 0x80)) {
335 *out++ = *in++;
338 *inlen = in - base;
347 * @inlenb: the length of @in in UTF-8 chars
384 * @in: a pointer to an array of UTF-8 chars
385 * @inlen: the length of @in
387 * Take a block of UTF-8 chars in and try to convert it to an ISO Latin 1
398 const unsigned char* in, int *inlen) {
399 const unsigned char* processed = in;
402 const unsigned char* instart = in;
408 if (in == NULL) {
416 inend = in + (*inlen);
418 while (in < inend) {
419 d = *in++;
422 /* trailing byte in leading position */
430 /* no chance for this in IsoLat1 */
436 if (inend - in < trailing) {
441 if (in >= inend)
443 if (((d= *in++) & 0xC0) != 0x80) {
458 /* no chance for this in IsoLat1 */
463 processed = in;
476 * @inlenb: the length of @in in UTF-16LE chars
478 * Take a block of UTF-16LE ushorts in and try to convert it to an UTF-8
484 * if the transcoding fails (if *in is not a valid utf16 string)
495 unsigned short* in = (unsigned short*) inb;
504 inend = in + inlen;
505 while ((in < inend) && (out - outstart + 5 < *outlen)) {
507 c= *in++;
509 tmp = (unsigned char *) in;
512 in++;
515 if (in >= inend) { /* (in > inend) shouldn't happens */
519 d = *in++;
521 tmp = (unsigned char *) in;
524 in++;
552 processed = (const unsigned char*) in;
564 * @in: a pointer to an array of UTF-8 chars
565 * @inlen: the length of @in
567 * Take a block of UTF-8 chars in and try to convert it to an UTF-16LE
575 const unsigned char* in, int *inlen)
578 const unsigned char* processed = in;
579 const unsigned char *const instart = in;
590 if (in == NULL) {
595 inend= in + *inlen;
597 while (in < inend) {
598 d= *in++;
601 /* trailing byte in leading position */
609 /* no chance for this in UTF-16 */
615 if (inend - in < trailing) {
620 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
662 processed = in;
673 * @in: a pointer to an array of UTF-8 chars
674 * @inlen: the length of @in
676 * Take a block of UTF-8 chars in and try to convert it to an UTF-16
684 const unsigned char* in, int *inlen)
686 if (in == NULL) {
705 return (UTF8ToUTF16LE(outb, outlen, in, inlen));
714 * @inlenb: the length of @in in UTF-16 chars
716 * Take a block of UTF-16 ushorts in and try to convert it to an UTF-8
722 * if the transcoding fails (if *in is not a valid utf16 string)
733 unsigned short* in = (unsigned short*) inb;
742 inend= in + inlen;
743 while (in < inend) {
745 tmp = (unsigned char *) in;
749 in++;
751 c= *in++;
754 if (in >= inend) { /* (in > inend) shouldn't happens */
760 tmp = (unsigned char *) in;
764 in++;
766 d= *in++;
794 processed = (const unsigned char*) in;
806 * @in: a pointer to an array of UTF-8 chars
807 * @inlen: the length of @in
809 * Take a block of UTF-8 chars in and try to convert it to an UTF-16BE
817 const unsigned char* in, int *inlen)
820 const unsigned char* processed = in;
821 const unsigned char *const instart = in;
832 if (in == NULL) {
837 inend= in + *inlen;
839 while (in < inend) {
840 d= *in++;
843 /* trailing byte in leading position */
851 /* no chance for this in UTF-16 */
857 if (inend - in < trailing) {
862 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) break;
901 processed = in;
917 * @in: a pointer to the first bytes of the XML entity, must be at least
927 xmlDetectCharEncoding(const unsigned char* in, int len)
929 if (in == NULL)
932 if ((in[0] == 0x00) && (in[1] == 0x00) &&
933 (in[2] == 0x00) && (in[3] == 0x3C))
935 if ((in[0] == 0x3C) && (in[1] == 0x00) &&
936 (in[2] == 0x00) && (in[3] == 0x00))
938 if ((in[0] == 0x00) && (in[1] == 0x00) &&
939 (in[2] == 0x3C) && (in[3] == 0x00))
941 if ((in[0] == 0x00) && (in[1] == 0x3C) &&
942 (in[2] == 0x00) && (in[3] == 0x00))
944 if ((in[0] == 0x4C) && (in[1] == 0x6F) &&
945 (in[2] == 0xA7) && (in[3] == 0x94))
947 if ((in[0] == 0x3C) && (in[1] == 0x3F) &&
948 (in[2] == 0x78) && (in[3] == 0x6D))
955 if ((in[0] == 0x3C) && (in[1] == 0x00) &&
956 (in[2] == 0x3F) && (in[3] == 0x00))
958 if ((in[0] == 0x00) && (in[1] == 0x3C) &&
959 (in[2] == 0x00) && (in[3] == 0x3F))
967 if ((in[0] == 0xEF) && (in[1] == 0xBB) &&
968 (in[2] == 0xBF))
973 if ((in[0] == 0xFE) && (in[1] == 0xFF))
975 if ((in[0] == 0xFF) && (in[1] == 0xFE))
1007 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
1043 * @name: the encoding name as parsed, in UTF-8 format (ASCII actually)
1044 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
1049 * Returns 0 in case of success, -1 in case of error
1102 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
1106 * Returns 0 in case of success, -1 in case of error
1135 * @name: the encoding name as parsed, in UTF-8 format (ASCII actually)
1139 * [XML] 4.3.3 Character Encoding in Entities.
1173 * already found and in use
1184 * already found and in use
1223 * Section 4.3.3 Character Encoding in Entities
1304 * @name: the encoding name, in UTF-8 format (ASCII actually)
1310 * Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
1389 * in normal processing.
1497 * Search in the registered set the handler able to read/write that encoding.
1557 * We used to keep ISO Latin encodings native in the
1631 * Search in the registered set the handler able to read/write that encoding.
1782 * @in: a pointer to an array of ISO Latin 1 chars
1783 * @inlen: the length of @in
1787 * -2 if the transcoding fails (for *in is not valid utf8 string or
1797 const unsigned char *in, int *inlen) {
1799 const char *icv_in = (const char *) in;
1803 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
1849 * @in: a pointer to an array of ISO Latin 1 chars
1850 * @inlen: the length of @in
1854 * -2 if the transcoding fails (for *in is not valid utf8 string or
1864 const unsigned char *in, int *inlen) {
1865 const char *ucv_in = (const char *) in;
1869 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
1892 *inlen = ucv_in - (const char*) in;
1915 * @in: an xmlBuffer for the input
1923 * -2 if the transcoding fails (for *in is not valid utf8 string or
1928 xmlBufferPtr in, int len) {
1935 if (in == NULL) return(-1);
1939 toconv = in->use;
1962 in->content, &toconv);
1963 xmlBufferShrink(in, toconv);
1970 &written, in->content, &toconv);
1971 xmlBufferShrink(in, toconv);
1980 &written, in->content, &toconv);
1981 xmlBufferShrink(in, toconv);
1996 toconv, written, in->use);
2004 toconv, written, in->use);
2022 * @in: an xmlBuffer for the input
2029 * -2 if the transcoding fails (for *in is not valid utf8 string or
2034 xmlBufferPtr in) {
2035 return(xmlCharEncFirstLineInt(handler, out, in, -1));
2050 * -2 if the transcoding fails (for *in is not valid utf8 string or
2061 xmlBufPtr in;
2068 in = input->raw;
2070 toconv = xmlBufUse(in);
2100 xmlBufContent(in), &c_in);
2101 xmlBufShrink(in, c_in);
2107 &c_out, xmlBufContent(in), &c_in);
2108 xmlBufShrink(in, c_in);
2117 &c_out, xmlBufContent(in), &c_in);
2118 xmlBufShrink(in, c_in);
2136 c_in, c_out, (int)xmlBufUse(in));
2143 c_in, c_out, (int)xmlBufUse(in));
2148 const xmlChar *content = xmlBufContent(in);
2176 * -2 if the transcoding fails (for *in is not valid utf8 string or
2187 xmlBufPtr in;
2194 in = input->raw;
2196 toconv = xmlBufUse(in);
2217 xmlBufContent(in), &c_in);
2218 xmlBufShrink(in, c_in);
2224 &c_out, xmlBufContent(in), &c_in);
2225 xmlBufShrink(in, c_in);
2234 &c_out, xmlBufContent(in), &c_in);
2235 xmlBufShrink(in, c_in);
2253 c_in, c_out, (int)xmlBufUse(in));
2260 c_in, c_out, (int)xmlBufUse(in));
2265 const xmlChar *content = xmlBufContent(in);
2288 * @in: an xmlBuffer for the input
2294 * -2 if the transcoding fails (for *in is not valid utf8 string or
2299 xmlBufferPtr in)
2309 if (in == NULL)
2312 toconv = in->use;
2322 in->content, &toconv);
2323 xmlBufferShrink(in, toconv);
2330 &written, in->content, &toconv);
2331 xmlBufferShrink(in, toconv);
2341 &written, in->content, &toconv);
2342 xmlBufferShrink(in, toconv);
2361 toconv, written, in->use);
2368 toconv, written, in->use);
2375 in->content[0], in->content[1],
2376 in->content[2], in->content[3]);
2398 * output in case of non-stateless encoding needing to initiate their
2399 * state or the output (like the BOM in UTF16).
2405 * -2 if the transcoding fails (for *in is not valid utf8 string or
2417 xmlBufPtr in;
2425 in = output->buffer;
2469 toconv = xmlBufUse(in);
2485 xmlBufContent(in), &c_in);
2487 xmlBufShrink(in, c_in);
2495 &c_out, xmlBufContent(in), &c_in);
2496 xmlBufShrink(in, c_in);
2514 &c_out, xmlBufContent(in), &c_in);
2515 xmlBufShrink(in, c_in);
2558 c_in, c_out, (int) xmlBufUse(in));
2562 int len = (int) xmlBufUse(in);
2563 xmlChar *content = xmlBufContent(in);
2574 xmlBufShrink(in, charref_len - c_out);
2597 xmlBufShrink(in, len);
2598 xmlBufAddHead(in, charref, -1);
2611 if (xmlBufGetAllocationScheme(in) != XML_BUFFER_ALLOC_IMMUTABLE)
2624 * @in: an xmlBuffer for the input
2627 * a first call with @in == NULL has to be made firs to initiate the
2628 * output in case of non-stateless encoding needing to initiate their
2629 * state or the output (like the BOM in UTF16).
2635 * -2 if the transcoding fails (for *in is not valid utf8 string or
2640 xmlBufferPtr in) {
2659 * First specific handling of in = NULL, i.e. the initialization call
2661 if (in == NULL) {
2698 toconv = in->use;
2707 in->content, &toconv);
2709 xmlBufferShrink(in, toconv);
2718 &written, in->content, &toconv);
2719 xmlBufferShrink(in, toconv);
2739 &written, in->content, &toconv);
2740 xmlBufferShrink(in, toconv);
2784 toconv, written, in->use);
2788 int len = in->use;
2789 const xmlChar *utf = (const xmlChar *) in->content;
2800 xmlBufferShrink(in, charref_len - written);
2813 in->content[0], in->content[1],
2814 in->content[2], in->content[3]);
2823 xmlBufferShrink(in, len);
2824 xmlBufferAddHead(in, charref, -1);
2831 in->content[0], in->content[1],
2832 in->content[2], in->content[3]);
2837 if (in->alloc != XML_BUFFER_ALLOC_IMMUTABLE)
2838 in->content[0] = ' ';
2852 * Returns 0 if success, or -1 in case of error
2916 * to the start of the current entity. This function is computed in
2918 * size in byte of the file if parsing a file. The function is
2922 * Returns the index in bytes from the beginning of the entity or -1
2923 * in case the index could not be computed.
2927 xmlParserInputPtr in;
2930 in = ctxt->input;
2931 if (in == NULL) return(-1);
2932 if ((in->buf != NULL) && (in->buf->encoder != NULL)) {
2934 xmlCharEncodingHandler * handler = in->buf->encoder;
2940 if (in->end - in->cur > 0) {
2942 const unsigned char *cur = (const unsigned char *)in->cur;
2943 int toconv = in->end - in->cur, written = 32000;
2949 toconv = in->end - cur;
2960 toconv = in->end - cur;
2977 toconv = in->end - cur;
2996 if (in->buf->rawconsumed < unused)
2998 return(in->buf->rawconsumed - unused);
3000 return(in->consumed + (in->cur - in->base));
3010 * @in: a pointer to an array of UTF-8 chars
3011 * @inlen: the length of @in
3014 * Take a block of UTF-8 chars in and try to convert it to an ISO 8859-*
3024 const unsigned char* in, int *inlen,
3028 const unsigned char* instart = in;
3029 const unsigned char* processed = in;
3034 if (in == NULL) {
3042 inend = in + (*inlen);
3043 while (in < inend) {
3044 unsigned char d = *in++;
3048 /* trailing byte in leading position */
3054 if (!(in < inend)) {
3055 /* trailing byte not in input buffer */
3060 c = *in++;
3071 /* not in character set */
3080 if (!(in < inend - 1)) {
3081 /* trailing bytes not in input buffer */
3086 c1 = *in++;
3093 c2 = *in++;
3106 /* not in character set */
3118 processed = in;
3129 * @in: a pointer to an array of ISO Latin 1 chars
3130 * @inlen: the length of @in
3132 * Take a block of ISO 8859-* chars in and try to convert it to an UTF-8
3140 const unsigned char* in, int *inlen,
3144 const unsigned char* instart = in;
3150 (in == NULL) || (unicodetable == NULL))
3153 inend = in + *inlen;
3156 while ((in < inend) && (out < outend - 2)) {
3157 if (*in >= 0x80) {
3158 c = unicodetable [*in - 0x80];
3162 *inlen = in - instart;
3173 ++in;
3175 if (instop - in > outend - out) instop = in + (outend - out);
3176 while ((*in < 0x80) && (in < instop)) {
3177 *out++ = *in++;
3180 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3181 *out++ = *in++;
3183 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3184 *out++ = *in++;
3187 *inlen = in - instart;
3928 const unsigned char* in, int *inlen) {
3929 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_2);
3932 const unsigned char* in, int *inlen) {
3933 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_2);
3937 const unsigned char* in, int *inlen) {
3938 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_3);
3941 const unsigned char* in, int *inlen) {
3942 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_3);
3946 const unsigned char* in, int *inlen) {
3947 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_4);
3950 const unsigned char* in, int *inlen) {
3951 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_4);
3955 const unsigned char* in, int *inlen) {
3956 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_5);
3959 const unsigned char* in, int *inlen) {
3960 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_5);
3964 const unsigned char* in, int *inlen) {
3965 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_6);
3968 const unsigned char* in, int *inlen) {
3969 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_6);
3973 const unsigned char* in, int *inlen) {
3974 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_7);
3977 const unsigned char* in, int *inlen) {
3978 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_7);
3982 const unsigned char* in, int *inlen) {
3983 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_8);
3986 const unsigned char* in, int *inlen) {
3987 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_8);
3991 const unsigned char* in, int *inlen) {
3992 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_9);
3995 const unsigned char* in, int *inlen) {
3996 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_9);
4000 const unsigned char* in, int *inlen) {
4001 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_10);
4004 const unsigned char* in, int *inlen) {
4005 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_10);
4009 const unsigned char* in, int *inlen) {
4010 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_11);
4013 const unsigned char* in, int *inlen) {
4014 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_11);
4018 const unsigned char* in, int *inlen) {
4019 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_13);
4022 const unsigned char* in, int *inlen) {
4023 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_13);
4027 const unsigned char* in, int *inlen) {
4028 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_14);
4031 const unsigned char* in, int *inlen) {
4032 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_14);
4036 const unsigned char* in, int *inlen) {
4037 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_15);
4040 const unsigned char* in, int *inlen) {
4041 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_15);
4045 const unsigned char* in, int *inlen) {
4046 return ISO8859xToUTF8 (out, outlen, in, inlen, xmlunicodetable_ISO8859_16);
4049 const unsigned char* in, int *inlen) {
4050 return UTF8ToISO8859x (out, outlen, in, inlen, xmltranscodetable_ISO8859_16);