Index: parser.c =================================================================== RCS file: /cvs/gnome/gnome-xml/parser.c,v retrieving revision 1.156 diff -c -r1.156 parser.c *** parser.c 2001/07/26 20:05:51 1.156 --- parser.c 2001/07/28 17:07:58 *************** *** 7297,7314 **** if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); ! /* ! * Get the 4 first bytes and decode the charset ! * if enc != XML_CHAR_ENCODING_NONE ! * plug some encoding conversion routines. ! */ ! start[0] = RAW; ! start[1] = NXT(1); ! start[2] = NXT(2); ! start[3] = NXT(3); ! enc = xmlDetectCharEncoding(start, 4); ! if (enc != XML_CHAR_ENCODING_NONE) { ! xmlSwitchEncoding(ctxt, enc); } --- 7297,7316 ---- if ((ctxt->sax) && (ctxt->sax->setDocumentLocator)) ctxt->sax->setDocumentLocator(ctxt->userData, &xmlDefaultSAXLocator); ! if (ctxt->encoding == XML_CHAR_ENCODING_NONE) { ! /* ! * Get the 4 first bytes and decode the charset ! * if enc != XML_CHAR_ENCODING_NONE ! * plug some encoding conversion routines. ! */ ! start[0] = RAW; ! start[1] = NXT(1); ! start[2] = NXT(2); ! start[3] = NXT(3); ! enc = xmlDetectCharEncoding(start, 4); ! if (enc != XML_CHAR_ENCODING_NONE) { ! xmlSwitchEncoding(ctxt, enc); ! } }