UTF-16 to UTF-8

"lijl" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel,gmane.spam.detected
Message-ID <[email protected]>
   Hi,
   I use gateway1.2.0 & xmllib 2.4.9 to transform UTF16 to UTF8 .at the beginning of 
parsing ,i  met an error , i did'nt know the reason why the error happened, who can help me ?
/***************UTF-16 text*******************************************/
<?xml version="1.0" encoding="UTF-16"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD
/wml_1.1.xml">
<wml>
        <card id="card1" title="&#x91d1;">
                <p>
                        Welcome
                </p>
        </card>
</wml>
/********************************************************************/

   thanks
                 
                            Greetings
                              lijl
error_process.txt (application/octet-stream, 22.5 KB)
gdb wml_tester
GNU gdb 19991004
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) b 124
Breakpoint 1 at 0x804a540: file test/wml_tester.c, line 124.
(gdb) r -b -f binary /home/ljl/get.wml
Starting program: /work/home/ljl/gateway-1.2.0/test/wml_tester -b -f binary /hom
e/ljl/get.wml

Breakpoint 1, main (argc=5, argv=0xbffffb04) at test/wml_tester.c:124
124                 ret = wml_compile(wml_text, charset, &wml_binary);
(gdb) s
wml_compile (wml_text=0x810be40, charset=0x0, wml_binary=0xbffffab0)
    at gw/wml_compiler.c:267
267         xmlDocPtr pDoc = NULL;
(gdb) n
277         wml_binary_t *wbxml = NULL;
(gdb)
279         *wml_binary = octstr_create("");
(gdb)
280         wbxml = wml_binary_create();
(gdb)
284         octstr_strip_blanks(wml_text);
(gdb)
289         parse_entities(wml_text);
(gdb)
290         set_charset(wml_text, charset);
(gdb)
292         size = octstr_len(wml_text);
(gdb)
297         iEncoding = 0;
(gdb)
299         if /*(*/(((iSearchRetCstr = octstr_search_cstr(wml_text, "encoding=\
"UTF-8\"", 0)) != -1)
(gdb)
306         if (iEncoding == UTF8)
(gdb)
309               strWmlTextData = octstr_get_cstr (wml_text);
(gdb)
311             if ((wml_c_text = (char *) gw_malloc (strlen(strWmlTextData) * 2
)) == NULL){
(gdb)
315             bzero (wml_c_text, (strlen(strWmlTextData) * 2));
(gdb)
316             iLoopSorry = 0;
(gdb)
317             while (((iDeckProcRet = ifnDeckSearch (wml_c_text, strWmlTextDat
a))
(gdb)
318                                   == CANNOTPROCESS) || (iDeckProcRet == PCDA
TAERROR)) {
(gdb)
348             if ((iDeckProcRet == MEMORYERROR)
(gdb)
354             size = strlen (wml_c_text);
(gdb)
360         if (octstr_search_char(wml_text, '\0', 0) != -1) {
(gdb)
372             pDoc = xmlParseMemory( wml_c_text, size);
(gdb) b  xmlParseMemory
Breakpoint 2 at 0x400a3ef8: file parser.c, line 10073.
(gdb) s

Breakpoint 2, xmlParseMemory (
    buffer=0x810c0c8 "<?xml version=\"1.0\" encoding=\"UTF-16\" ?><!DOCTYPE wml
PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD\n/wml_1.1.
xml\"><wml><card id=\"ÚcÚaÚrÚdÚ1Ú\" title=\"»ÑÚ\"><p>Ú\nÚ\tÚ\tÚ\tÚWÚeÚlÚcÚoÚmÚe"
..., size=226) at parser.c:10073
10073      return(xmlSAXParseMemory(NULL, buffer, size, 0));
(gdb) b xmlSAXParseMemory
Breakpoint 3 at 0x400a3e76: file parser.c, line 10041.
(gdb) s

Breakpoint 3, xmlSAXParseMemory (sax=0x0,
    buffer=0x810c0c8 "<?xml version=\"1.0\" encoding=\"UTF-16\" ?><!DOCTYPE wml
PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD\n/wml_1.1.
xml\"><wml><card id=\"ÚcÚaÚrÚdÚ1Ú\" title=\"»ÑÚ\"><p>Ú\nÚ\tÚ\tÚ\tÚWÚeÚlÚcÚoÚmÚe"
..., size=226, recovery=0) at parser.c:10041
10041       ctxt = xmlCreateMemoryParserCtxt(buffer, size);
(gdb) n
10042       if (ctxt == NULL) return(NULL);
(gdb) n
10043       if (sax != NULL) {
(gdb) n
10047       xmlParseDocument(ctxt);
(gdb) b xmlParseDocument
Breakpoint 4 at 0x400a0a24: file parser.c, line 7442.
(gdb) s

Breakpoint 4, xmlParseDocument (ctxt=0x810c570) at parser.c:7442
7442        xmlInitParser();
(gdb) n
7444        GROW;
(gdb) n
7449        if ((ctxt->sax) && (ctxt->sax->setDocumentLocator))
(gdb) n
7450            ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLoca
tor);
(gdb) n
7452        if (ctxt->encoding == (const xmlChar *)XML_CHAR_ENCODING_NONE) {
(gdb) n
7458            start[0] = RAW;
(gdb) n
7459            start[1] = NXT(1);
(gdb) n
7460            start[2] = NXT(2);
(gdb) n
7461            start[3] = NXT(3);
(gdb) n
7462            enc = xmlDetectCharEncoding(start, 4);
(gdb) p start[0]
$1 = 60 '<'
(gdb) p start[1]
$2 = 63 '?'
(gdb) p start[2]
$3 = 120 'x'
(gdb) p start[3]
$4 = 109 'm'
(gdb) p enc
$5 = 1836597052
(gdb) n
7463            if (enc != XML_CHAR_ENCODING_NONE) {
(gdb) penc
Undefined command: "penc".  Try "help".
(gdb) p enc
$6 = XML_CHAR_ENCODING_UTF8
(gdb) n
7464                xmlSwitchEncoding(ctxt, enc);
(gdb) b xmlSwitchEncoding
Breakpoint 5 at 0x4009157f: file parserInternals.c, line 1565.
(gdb) s

Breakpoint 5, xmlSwitchEncoding (ctxt=0x810c570, enc=XML_CHAR_ENCODING_UTF8)
    at parserInternals.c:1565
1565        switch (enc) {
(gdb) n
1579                ctxt->charset = XML_CHAR_ENCODING_UTF8;
(gdb) n
1586                if ((ctxt->input != NULL) &&
(gdb) n
1618                    return(0);
(gdb) n
1705    }
(gdb) n
xmlParseDocument (ctxt=0x810c570) at parser.c:7465
7465            }
(gdb) n
7469        if (CUR == 0) {
(gdb) n
7480        GROW;
(gdb) n
7481        if ((RAW == '<') && (NXT(1) == '?') &&
(gdb) n
7488            xmlParseXMLDecl(ctxt);
(gdb) b xmlParseXMLDecl
Breakpoint 6 at 0x400a0541: file parser.c, line 7307.
(gdb) s

Breakpoint 6, xmlParseXMLDecl (ctxt=0x810c570) at parser.c:7307
7307        SKIP(5);
(gdb) n
7309        if (!IS_BLANK(RAW)) {
(gdb) n
7316        SKIP_BLANKS;
(gdb) n
7321        version = xmlParseVersionInfo(ctxt);
(gdb) n
7322        if (version == NULL)
(gdb) p version
$7 = (xmlChar *) 0x810f0a0 "1.0"
(gdb) n
7324        else if (!xmlStrEqual(version, (const xmlChar *) XML_DEFAULT_VERSION
)) {
(gdb) n
7332        ctxt->version = xmlStrdup(version);
(gdb) n
7333        xmlFree(version);
(gdb) n
7338        if (!IS_BLANK(RAW)) {
(gdb) n
7349        xmlParseEncodingDecl(ctxt);
(gdb) b xmlParseEncodingDecl
Breakpoint 7 at 0x4009fe80: file parser.c, line 7087.
(gdb) s

Breakpoint 7, xmlParseEncodingDecl (ctxt=0x810c570) at parser.c:7087
7087        xmlChar *encoding = NULL;
(gdb) n
7090        SKIP_BLANKS;
(gdb)
7091        if ((RAW == 'e') && (NXT(1) == 'n') &&
(gdb)
7095            SKIP(8);
(gdb)
7096            SKIP_BLANKS;
(gdb)
7097            if (RAW != '=') {
(gdb)
7106            NEXT;
(gdb)
7107            SKIP_BLANKS;
(gdb)
7108            if (RAW == '"') {
(gdb)
7109                NEXT;
(gdb)
7110                q = CUR_PTR;
(gdb)
7111                encoding = xmlParseEncName(ctxt);
(gdb)
7112                if (RAW != '"') {
(gdb) p encoding
$8 = (xmlChar *) 0x810f0a0 "UTF-16"
(gdb) n
7133                    NEXT;
(gdb) n
7134            } else if (RAW == '"'){
(gdb) n
7142            if (encoding != NULL) {
(gdb) n
7146                if (ctxt->input->encoding != NULL)
(gdb) n
7148                ctxt->input->encoding = encoding;
(gdb) n
7150                enc = xmlParseCharEncoding((const char *) encoding);
(gdb) n
7154                if (enc != XML_CHAR_ENCODING_ERROR) {
(gdb) p enc
$9 = XML_CHAR_ENCODING_UTF16LE
(gdb) n
7155                    xmlSwitchEncoding(ctxt, enc);
(gdb) b xmlSwitchEncoding
Note: breakpoint 5 also set at pc 0x4009157f.
Breakpoint 8 at 0x4009157f: file parserInternals.c, line 1565.
(gdb) s

Breakpoint 5, xmlSwitchEncoding (ctxt=0x810c570, enc=XML_CHAR_ENCODING_UTF16LE)
    at parserInternals.c:1565
1565        switch (enc) {
(gdb) n
1596        handler = xmlGetCharEncodingHandler(enc);
(gdb) n
1597        if (handler == NULL) {
(gdb) p handler
$10 = 0x810d898
(gdb) p *handler
$11 = {name = 0x810d888 "UTF-16LE", input = 0x4008c328 <UTF16LEToUTF8>,
  output = 0x4008c508 <UTF8ToUTF16LE>, iconv_in = 0x0, iconv_out = 0x0}
(gdb) n
1703        ctxt->charset = XML_CHAR_ENCODING_UTF8;
(gdb) n
1704        return(xmlSwitchToEncoding(ctxt, handler));
(gdb)  bxmlSwitchToEncoding
Undefined command: "bxmlSwitchToEncoding".  Try "help".
(gdb)  b xmlSwitchToEncoding
Breakpoint 9 at 0x400918c5: file parserInternals.c, line 1722.
(gdb) s

Breakpoint 9, xmlSwitchToEncoding (ctxt=0x810c570, handler=0x810d898)
    at parserInternals.c:1722
1722        if (handler != NULL) {
(gdb) n
1723            if (ctxt->input != NULL) {
(gdb) n
1724                if (ctxt->input->buf != NULL) {
(gdb) n
1725                    if (ctxt->input->buf->encoder != NULL) {
(gdb) n
1737                    ctxt->input->buf->encoder = handler;
(gdb) n
1742                    if ((ctxt->input->buf->buffer != NULL) &&
(gdb) n
1750                        if ((handler->name != NULL) &&
(gdb) n
1751                            (!strcmp(handler->name, "UTF-16LE")) &&
(gdb) n
1756                        if ((handler->name != NULL) &&
(gdb) n
1757                            (!strcmp(handler->name, "UTF-16BE")) &&
(gdb) n
1767                        if ((handler->name != NULL) &&
(gdb) n
1768                            (!strcmp(handler->name, "UTF-8")) &&
(gdb) n
1779                        processed = ctxt->input->cur - ctxt->input->base;
(gdb) n
1780                        xmlBufferShrink(ctxt->input->buf->buffer, processed)
;
(gdb) n
1781                        ctxt->input->buf->raw = ctxt->input->buf->buffer;
(gdb) n
1782                        ctxt->input->buf->buffer = xmlBufferCreate();
(gdb) n
1784                        if (ctxt->html) {
(gdb) n
1798                            nbchars = xmlCharEncFirstLine(ctxt->input->buf->
encoder,
(gdb) b xmlCharEncFirstLine
Breakpoint 10 at 0x4008ddac: file encoding.c, line 1958.
(gdb) s

Breakpoint 10, xmlCharEncFirstLine (handler=0x810d898, out=0x810f0c0,
    in=0x810c7d0) at encoding.c:1958
1958        int ret = -2;
(gdb) n
1962        if (handler == NULL) return(-1);
(gdb) n
1963        if (out == NULL) return(-1);
(gdb) n
1964        if (in == NULL) return(-1);
(gdb) n
1966        written = out->size - out->use;
(gdb) n
1967        toconv = in->use;
(gdb) n
1968        if (toconv * 2 >= written) {
(gdb) n
1978        written = 45;
(gdb) n
1980        if (handler->input != NULL) {
(gdb) n
1981            ret = handler->input(&out->content[out->use], &written,
(gdb) n
1983            xmlBufferShrink(in, toconv);
(gdb) b xmlBufferShrink
Breakpoint 11 at 0x400a89e4: file tree.c, line 4869.
(gdb) s

Breakpoint 11, xmlBufferShrink (buf=0x810c7d0, len=28) at tree.c:4869
4869        if (len == 0) return(0);
(gdb) n
4870        if (len > buf->use) return(-1);
(gdb) n
4872        buf->use -= len;
(gdb) n
4873        memmove(buf->content, &buf->content[len], buf->use * sizeof(xmlChar)
);
(gdb) n
4875        buf->content[buf->use] = 0;
(gdb) n
4876        return(len);
(gdb) n
4877    }
(gdb) n
xmlCharEncFirstLine (handler=0x810d898, out=0x810f0c0, in=0x810c7d0)
    at encoding.c:1984
1984            out->use += written;
(gdb) n
1985            out->content[out->use] = 0;
(gdb) n
1986        }
(gdb) n
2023        if (ret == -3) ret = 0;
(gdb) n
2024        if (ret == -1) ret = 0;
(gdb) p ret
$12 = 0
(gdb) n
2025        return(ret);
(gdb) n
2026    }
(gdb) n
xmlSwitchToEncoding (ctxt=0x810c570, handler=0x810d898)
    at parserInternals.c:1801
1801                        }
(gdb) n
1802                        if (nbchars < 0) {
(gdb) n
1807                        ctxt->input->base =
(gdb) n
1809                        ctxt->input->end =
(gdb) n
1813                    return(0);
(gdb) n
1727                            return(0);
(gdb) n
1877    }
(gdb) n
xmlSwitchEncoding (ctxt=0x810c570, enc=XML_CHAR_ENCODING_UTF16LE)
    at parserInternals.c:1705
1705    }
(gdb) n
xmlParseEncodingDecl (ctxt=0x810c570) at parser.c:7156
7156                    if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
(gdb) n
7177        return(encoding);
(gdb) n
7178    }
(gdb) n
xmlParseXMLDecl (ctxt=0x810c570) at parser.c:7350
7350        if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
(gdb) n
7360        if ((ctxt->input->encoding != NULL) && (!IS_BLANK(RAW))) {
(gdb) n
7361            if ((RAW == '?') && (NXT(1) == '>')) {
(gdb) n
7365            ctxt->errNo = XML_ERR_SPACE_REQUIRED;
(gdb) n
7366            if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))//lijl
(gdb) n
7367                ctxt->sax->error(ctxt->userData, "Blank needed here\n");
(gdb) n
Entity: line 1: error: Blank needed here
㼠㰾䐡䍏奔䕐眠汭倠䉕䥌⁃ⴢ⼯
^
7368            ctxt->wellFormed = 0;
(gdb) n
7369            ctxt->disableSAX = 1;
(gdb) n
7371        SKIP_BLANKS;
(gdb) n
7372        ctxt->input->standalone = xmlParseSDDecl(ctxt);
(gdb) n
7374        SKIP_BLANKS;
(gdb) n
7375        if ((RAW == '?') && (NXT(1) == '>')) {
(gdb) n
7387            ctxt->errNo = XML_ERR_XMLDECL_NOT_FINISHED;
(gdb) n
7388            if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
(gdb) n
7389                ctxt->sax->error(ctxt->userData,
(gdb) n
Entity: line 1: error: parsing XML declaration: '?>' expected
㼠㰾䐡䍏奔䕐眠汭倠䉕䥌⁃ⴢ⼯
^
7391            ctxt->wellFormed = 0;
(gdb) n
7392            ctxt->disableSAX = 1;
(gdb) n
7393            MOVETO_ENDTAG(CUR_PTR);
(gdb) n
7394            NEXT;
(gdb) n

Breakpoint 11, xmlBufferShrink (buf=0x810c7d0, len=84) at tree.c:4869
4869        if (len == 0) return(0);
(gdb) n
4870        if (len > buf->use) return(-1);
(gdb) n
4872        buf->use -= len;
(gdb) n
4873        memmove(buf->content, &buf->content[len], buf->use * sizeof(xmlChar)
);
(gdb) n
4875        buf->content[buf->use] = 0;
(gdb) n
4876        return(len);
(gdb) n
4877    }
(gdb) n
xmlCharEncInFunc (handler=0x810d898, out=0x810f0c0, in=0x810c7d0)
    at encoding.c:2068
2068            out->use += written;
(gdb) n
2069            out->content[out->use] = 0;
(gdb) n
2070        }
(gdb) n
2082        switch (ret) {
(gdb) n
2105                xmlGenericError(xmlGenericErrorContext,
(gdb) n
input conversion failed due to input error
2107                xmlGenericError(xmlGenericErrorContext,
(gdb) n
Bytes: 0x22 0xDA 0x63 0xDA
2115        if (ret == -3)
(gdb) n
2117        return (ret);
(gdb) n
2118    }
(gdb) n
xmlParserInputBufferGrow (in=0x810c7b0, len=250) at xmlIO.c:2153
2153            if (nbchars < 0) {
(gdb) n
2154                xmlGenericError(xmlGenericErrorContext,
(gdb) n
xmlParserInputBufferGrow: encoder error
2156                return(-1);
(gdb) n
2170    }
(gdb) n
xmlParserInputGrow (in=0x810d978, len=250) at parserInternals.c:1014
1014        if (in->base != in->buf->buffer->content) {
(gdb) n
1022        in->end = &in->buf->buffer->content[in->buf->buffer->use];
(gdb) n
1026        return(ret);
(gdb) n
1027    }
(gdb) n
xmlNextChar (ctxt=0x810c570) at parserInternals.c:1121
1121                    xmlPopInput(ctxt);
(gdb) n
1122            } else {
(gdb) n
1208        if ((*ctxt->input->cur == '%') && (!ctxt->html))
(gdb) n
1210        if ((*ctxt->input->cur == 0) &&
(gdb) n
1234    }
(gdb) n
xmlParseXMLDecl (ctxt=0x810c570) at parser.c:7396
7396    }
(gdb) n
xmlParseDocument (ctxt=0x810c570) at parser.c:7489
7489            if (ctxt->errNo == XML_ERR_UNSUPPORTED_ENCODING) {
(gdb) n
7495            ctxt->standalone = ctxt->input->standalone;
(gdb) n
7496            SKIP_BLANKS;
(gdb) n
7497        } else {
(gdb) n
7499        }
(gdb) n
7500        if ((ctxt->sax) && (ctxt->sax->startDocument) && (!ctxt->disableSAX)
)
(gdb) n
7506        GROW;
(gdb) n

Breakpoint 11, xmlBufferShrink (buf=0x810c7d0, len=0) at tree.c:4869
4869        if (len == 0) return(0);
(gdb) nn
Undefined command: "nn".  Try "help".
(gdb) n
4877    }
(gdb) n
xmlCharEncInFunc (handler=0x810d898, out=0x810f0c0, in=0x810c7d0)
    at encoding.c:2068
2068            out->use += written;
(gdb) n
2069            out->content[out->use] = 0;
(gdb) n
2070        }
(gdb) n
2082        switch (ret) {
(gdb) n
2105                xmlGenericError(xmlGenericErrorContext,
(gdb) n
input conversion failed due to input error
2107                xmlGenericError(xmlGenericErrorContext,
(gdb) n
Bytes: 0x22 0xDA 0x63 0xDA
2115        if (ret == -3)
(gdb) n
2117        return (ret);
(gdb) n
2118    }
(gdb) n
xmlParserInputBufferGrow (in=0x810c7b0, len=250) at xmlIO.c:2153
2153            if (nbchars < 0) {
(gdb) n
2154                xmlGenericError(xmlGenericErrorContext,
(gdb) n
xmlParserInputBufferGrow: encoder error
2156                return(-1);
(gdb) n
2170    }
(gdb) n
xmlParserInputGrow (in=0x810d978, len=250) at parserInternals.c:1014
1014        if (in->base != in->buf->buffer->content) {
(gdb) n
1022        in->end = &in->buf->buffer->content[in->buf->buffer->use];
(gdb) n
1026        return(ret);
(gdb) n
1027    }
(gdb)
xmlParseDocument (ctxt=0x810c570) at parser.c:7507
7507        xmlParseMisc(ctxt);
(gdb)
7513        GROW;
(gdb)

Breakpoint 11, xmlBufferShrink (buf=0x810c7d0, len=0) at tree.c:4869
4869        if (len == 0) return(0);
(gdb)
4877    }
(gdb)
xmlCharEncInFunc (handler=0x810d898, out=0x810f0c0, in=0x810c7d0)
    at encoding.c:2068
2068            out->use += written;
(gdb)
2069            out->content[out->use] = 0;
(gdb)
2070        }
(gdb)
2082        switch (ret) {
(gdb)
2105                xmlGenericError(xmlGenericErrorContext,
(gdb)
input conversion failed due to input error
2107                xmlGenericError(xmlGenericErrorContext,
(gdb)
Bytes: 0x22 0xDA 0x63 0xDA
2115        if (ret == -3)
(gdb)
2117        return (ret);
(gdb)
2118    }
(gdb)
xmlParserInputBufferGrow (in=0x810c7b0, len=250) at xmlIO.c:2153
2153            if (nbchars < 0) {
(gdb)
2154                xmlGenericError(xmlGenericErrorContext,
(gdb)
xmlParserInputBufferGrow: encoder error
2156                return(-1);
(gdb)
2170    }
(gdb)
xmlParserInputGrow (in=0x810d978, len=250) at parserInternals.c:1014
1014        if (in->base != in->buf->buffer->content) {
(gdb)
1022        in->end = &in->buf->buffer->content[in->buf->buffer->use];
(gdb)
1026        return(ret);
(gdb)
1027    }
(gdb)
xmlParseDocument (ctxt=0x810c570) at parser.c:7514
7514        if ((RAW == '<') && (NXT(1) == '!') &&
(gdb)
7545        GROW;
(gdb)

Breakpoint 11, xmlBufferShrink (buf=0x810c7d0, len=0) at tree.c:4869
4869        if (len == 0) return(0);
(gdb)
4877    }
(gdb)
xmlCharEncInFunc (handler=0x810d898, out=0x810f0c0, in=0x810c7d0)
    at encoding.c:2068
2068            out->use += written;
(gdb)
2069            out->content[out->use] = 0;
(gdb)
2070        }
(gdb)
2082        switch (ret) {
(gdb)
2105                xmlGenericError(xmlGenericErrorContext,
(gdb)
input conversion failed due to input error
2107                xmlGenericError(xmlGenericErrorContext,
(gdb)
Bytes: 0x22 0xDA 0x63 0xDA
2115        if (ret == -3)
(gdb)
2117        return (ret);
(gdb)
2118    }
(gdb)
xmlParserInputBufferGrow (in=0x810c7b0, len=250) at xmlIO.c:2153
2153            if (nbchars < 0) {
(gdb)
2154                xmlGenericError(xmlGenericErrorContext,
(gdb)
xmlParserInputBufferGrow: encoder error
2156                return(-1);
(gdb)
2170    }
(gdb)
xmlParserInputGrow (in=0x810d978, len=250) at parserInternals.c:1014
1014        if (in->base != in->buf->buffer->content) {
(gdb)
1022        in->end = &in->buf->buffer->content[in->buf->buffer->use];
(gdb)
1026        return(ret);
(gdb)
1027    }
(gdb)
xmlParseDocument (ctxt=0x810c570) at parser.c:7546
7546        if (RAW != '<') {
(gdb)
7547            ctxt->errNo = XML_ERR_DOCUMENT_EMPTY;
(gdb)
7548            if ((ctxt->sax != NULL) && (ctxt->sax->error != NULL))
(gdb)
7549                ctxt->sax->error(ctxt->userData,
(gdb)
7554        } else {
(gdb)
Entity: line 1: error: Start tag expected, '<' not found
㼠㰾䐡䍏奔䕐眠汭倠䉕䥌⁃ⴢ⼯䅗䙐剏䵕⼯呄⁄䵗⁌⸱⼱䔯â
                                         ^
7570                ctxt->wellFormed = 0;
(gdb)
7571                ctxt->disableSAX = 1;
(gdb)
7573            ctxt->instate = XML_PARSER_EOF;
(gdb)
7579        if ((ctxt->sax) && (ctxt->sax->endDocument != NULL) &&
(gdb)
7583        if (! ctxt->wellFormed) return(-1);
(gdb)
7585    }
(gdb)
xmlSAXParseMemory (sax=0x0,
    buffer=0x810c0c8 "<?xml version=\"1.0\" encoding=\"UTF-16\" ?><!DOCTYPE wml
PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD\n/wml_1.1.
xml\"><wml><card id=\"ÚcÚaÚrÚdÚ1Ú\" title=\"»ÑÚ\"><p>Ú\nÚ\tÚ\tÚ\tÚWÚeÚlÚcÚoÚmÚe"
..., size=226, recovery=0) at parser.c:10049
10049       if ((ctxt->wellFormed) || recovery) ret = ctxt->myDoc;
(gdb)
10051          ret = NULL;
(gdb)
10052          xmlFreeDoc(ctxt->myDoc);
(gdb)
10053          ctxt->myDoc = NULL;
(gdb)
10054       }
(gdb)
10055       if (sax != NULL)
(gdb)
10057       xmlFreeParserCtxt(ctxt);
(gdb)
10059       return(ret);
(gdb)
10060   }
(gdb)
xmlParseMemory (
    buffer=0x810c0c8 "<?xml version=\"1.0\" encoding=\"UTF-16\" ?><!DOCTYPE wml
PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD\n/wml_1.1.
xml\"><wml><card id=\"ÚcÚaÚrÚdÚ1Ú\" title=\"»ÑÚ\"><p>Ú\nÚ\tÚ\tÚ\tÚWÚeÚlÚcÚoÚmÚe"
..., size=226) at parser.c:10074
10074   }
(gdb)
wml_compile (wml_text=0x810be40, charset=0x0, wml_binary=0xbffffab0)
    at gw/wml_compiler.c:375
375             if (iEncoding != UTF8){
(gdb)
377                 gw_free (wml_c_text);
(gdb)
378             }
(gdb)
381             if(pDoc != NULL) {
(gdb)
389                 error(0,
(gdb)
393             }
(gdb)
396         wml_binary_destroy(wbxml);
(gdb)
398         if (pDoc)
(gdb)
401         return ret;
(gdb)
402     }
(gdb)
main (argc=5, argv=0xbffffb04) at test/wml_tester.c:125
125                 if (i < num)
(gdb)
123             for (i = 0; i <= num; i++) {
(gdb)
128             optind++;
(gdb)
130             output = octstr_format("wml_compile returned: %d\n\n", ret);
(gdb)
132             if (ret == 0) {
(gdb)
170             octstr_destroy(wml_text);
(gdb)
171             octstr_destroy(output);
(gdb)
172             octstr_destroy(wml_binary);
(gdb)
173         }
(gdb)
175         if (file) {
(gdb)
176             fclose(fp);
(gdb)
177             octstr_destroy(filename);
(gdb)
178         }
(gdb)
180         if (charset != NULL)
(gdb)
183         wml_shutdown();
(gdb)
(gdb)
184         gwlib_shutdown();
(gdb)
186         return ret;
(gdb)
187     }
(gdb)
0x4012c9cb in __libc_start_main (main=0x804a318 <main>, argc=5,
    argv=0xbffffb04, init=0x8049a18 <_init>, fini=0x80c2b1c <_fini>,
    rtld_fini=0x4000ae60 <_dl_fini>, stack_end=0xbffffafc)
    at ../sysdeps/generic/libc-start.c:92
92      ../sysdeps/generic/libc-start.c: No such file or directory.
(gdb)

Program exited with code 0377.
(gdb)
The program is not being run.
(gdb)
The program is not being run.
(gdb)
The program is not being run.
(gdb)
The program is not being run.
(gdb)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.