encoding.c


Log

Author Commit Date CI Message
Nick Wellnhofer f86d17c1 2024-07-04T15:14:54 encoding: Fix xmlParseCharEncoding Make "UTF-16" return the UTF16LE handler as before. Fix error return.
Nick Wellnhofer 46ec621e 2024-07-03T15:48:01 encoding: Clarify xmlUconvConvert
Nick Wellnhofer 48fec242 2024-07-03T15:11:20 encoding: Remove duplicate code Fix recent commit.
Nick Wellnhofer 71fb2579 2024-07-03T14:35:49 encoding: Fix ICU build
Nick Wellnhofer 9a4770ef 2024-07-02T02:18:03 doc: Improve documentation
Nick Wellnhofer 0b0dd989 2024-06-28T23:13:38 parser: Fix EBCDIC detection
Nick Wellnhofer 37a9ff11 2024-06-28T22:42:46 encoding: Simplify xmlCharEncCloseFunc
Nick Wellnhofer 1167c334 2024-06-28T21:51:21 encoding: Don't include iconv.h from libxml/encoding.h
Nick Wellnhofer 30be984a 2024-06-28T20:37:47 encoding: Rework ISO-8859-X conversion Optimize code. Pass tables as context parameter. Check for XML_ENC_ERR_SPACE.
Nick Wellnhofer 282ec1d5 2024-06-28T19:06:57 encoding: Rework xmlCharEncodingHandler layout Reuse some of the old members. The "input" and "output" function pointers are actually of type xmlCharEncConvFunc, accepting an additional argument. For default handlers, this argument is unused, so this should work with most ABIs. For iconv handlers, these function pointers used to be NULL but now point to a function which requires the extra argument. "iconv_in" and "iconv_out" are made void pointers. "uconv_in" and "uconv_out" are renamed and made void pointers. This is unlikely to cause issues. We now expect that the built-in conversion functions correctly report XML_ENC_ERR_SPACE. For UTF8ToHtml and the ISO-8859-X code, this will be done in the following commits.
Nick Wellnhofer 57e37dff 2017-06-17T21:43:48 encoding: Rework UTF-16 conversion functions Optimize UTF-16 conversion functions. Avoid misaligned memory access. Don't rely on 'sizeof(short) == 2'. Check for XML_ENC_ERR_SPACE. Add some tests for UTF-16 conversion.
Nick Wellnhofer bb8e81c7 2024-06-28T04:36:14 encoding: Rework simple conversions function Use a single function for ASCII conversion. Optimize code. Check for XML_ENC_ERR_SPACE.
Nick Wellnhofer 501e5d19 2024-06-28T04:10:03 encoding: Stop using XML_ENC_ERR_PARTIAL
Nick Wellnhofer c59c2449 2024-06-27T23:32:58 encoding: Support custom implementations
Nick Wellnhofer 1e3da9f4 2024-06-27T21:37:18 encoding: Start with callbacks
Nick Wellnhofer 6d8427dc 2024-06-27T20:39:52 encoding: Rework encoding lookup Add missing xmlCharEncoding enum values. Simplify and speed up encoding lookup by using a table mapping names to xmlCharEncoding enums and binary search. Rearrange the default handler table to match the enum layout. For some encodings we now only lookup the provided or most canonical name instead of trying several names, expecting that iconv or ICU handle aliases: - IBM037 (EBCDIC) - UCS-2 - UCS-4 - Shift_JIS
Nick Wellnhofer f4e63f7a 2024-06-27T15:15:06 Regenerate libxml2-api.xml and testapi.c
Nick Wellnhofer b1a416bf 2024-06-27T12:00:45 encoding: Restore old lookup order in xmlOpenCharEncodingHandler When looking up encodings with xmlLookupCharEncodingHandler, the returned handler can have a different name than requested (capitalization, internal aliases). This should eventually be fixed. For now we revert part of commit 5b893fa9, start the lookup with xmlFindHandler and add an explicit check for UTF-8. Should fix the encoding name issue mentioned in #749.
Nick Wellnhofer c4d8343b 2024-06-24T19:41:32 encoding: Make xmlFindCharEncodingHandler return UTF-8 handler xmlFindCharEncodingHandler must always return a handler. Remove UTF-8 handler from default handler list. Fixes 5b893fa9.
Nick Wellnhofer 5b893fa9 2024-06-22T19:15:17 encoding: Fix encoding lookup with xmlOpenCharEncodingHandler Make xmlOpenCharEncodingHandler call xmlParseCharEncoding first so we prefer our own handlers for names like "UTF8". Only UTF-16 needs an exception. Make callers check the return value. For UTF-8, a NULL encoding doesn't mean an error. Remove unnecessary UTF-8 check from htmlFindOutputEncoder. Don't try to look up ASCII handler since the HTML handler is always available. Fix return code of xmlParseCharEncoding. Should fix #744.
Rosen Penev 2def7b4b 2024-06-18T13:55:34 clang-tidy: move assignments out of if Found with bugprone-assignment-in-if-condition Signed-off-by: Rosen Penev <rosenp@gmail.com>
Nick Wellnhofer 63ce5f9a 2024-04-28T17:32:35 Make some globals const
Nick Wellnhofer 072facc4 2024-03-18T14:17:57 encoding: Don't shrink input too early in xmlCharEncOutput Some exotic encodings like ISO646-FR don't support '#' characters, so encoding a character reference can actually fail. Don't skip the offending input in this case so the error will be reported on the next call.
Nick Wellnhofer 0821efc8 2024-01-02T18:33:57 encoding: Check whether encoding handlers support input/output The "HTML" encoding handler doesn't support input which could lead to a wrong error report.
Nick Wellnhofer 023aecc4 2023-12-13T23:45:53 encoding: Support ASCII in xmlLookupCharEncodingHandler Return our built-in ASCII handler. This was never implemented and triggered the new and stricter error checks.
Nick Wellnhofer bd5ad030 2023-12-10T14:56:21 encoding: Report malloc failures Introduce new API functions that return a separate error code if a memory allocation fails. - xmlOpenCharEncodingHandler - xmlLookupCharEncodingHandler Fix a few places where malloc failures weren't reported.
Nick Wellnhofer 89d19534 2023-10-28T03:04:59 encoding: Fix decoding of large chunks After 95e81a36, we must support XML_ENC_ERR_SPACE when using built-in encoding handlers. Should fix #610.
Nick Wellnhofer 1734d27d 2023-10-02T15:04:18 encoding: Suppress -Wcast-align warnings
Nick Wellnhofer 0533daf5 2023-09-29T02:45:20 encoding: Fix infinite loop in xmlCharEncInput Short-lived regression from 95e81a36.
Nick Wellnhofer 8c084ebd 2023-09-21T22:57:33 doc: Make apibuild.py happy
Nick Wellnhofer 699299ca 2023-09-20T18:54:39 globals: Stop including globals.h
Nick Wellnhofer 7909ff08 2023-09-20T17:38:26 include: Remove unnecessary includes - Don't include tree.h from encoding.h - Don't include parser.h from xmlIO.h
Nick Wellnhofer 507f11ed 2023-08-16T15:43:47 encoding: Remove debugging code
Nick Wellnhofer 95e81a36 2023-08-08T15:21:31 parser: Decode all data in xmlCharEncInput Even with flush set to true, xmlCharEncInput didn't guarantee to decode all data. This complicated the push parser. Remove the flush flag and always decode all available data. Also fix ICU code where the flush flag has a different meaning. Always set flush to false and retry even with empty input buffers.
Nick Wellnhofer 4ee08155 2023-08-08T15:19:51 encoding: Move rawconsumed accounting to xmlCharEncInput
Nick Wellnhofer b236b7a5 2023-06-08T21:53:05 parser: Halt parser when growing buffer results in OOM Fix short-lived regression from previous commit. It might be safer to make xmlBufSetInputBaseCur use the original buffer even in case of errors. Found by OSS-Fuzz.
Nick Wellnhofer db21cd5d 2023-06-06T14:25:30 malloc-fail: Handle malloc failures in xmlAddEncodingAlias Avoid memory errors if an allocation fails. See #344. Fixes #553.
Nick Wellnhofer 2f12e3a9 2023-04-30T18:46:05 encoding: Stop calling xmlEncodingErr This invokes the global error handler which should be avoided.
Nick Wellnhofer 320f5084 2023-04-30T18:25:09 parser: Improve handling of encoding and IO errors Make sure that xmlCharEncInput, xmlParserInputBufferPush and xmlParserInputBufferGrow set the correct error code in the xmlParserInputBuffer. Handle errors when calling these functions.
Nick Wellnhofer 3ff6abbf 2023-02-22T17:11:20 encoding: Rework error codes Use an enum instead of magic numbers. Fix a few error codes. Simplify handling of "space" and "partial" errors. See #506.
Nick Wellnhofer 33fb297b 2023-04-15T16:53:00 encoding: Fix compiler warning in ICU build
Nick Wellnhofer a6b9e55a 2023-03-26T15:42:02 encoding: Fix error code in asciiToUTF8 Use correct error code when invalid ASCII bytes are encountered. Found by OSS-Fuzz.
Nick Wellnhofer 98840d40 2023-03-21T19:07:12 parser: Rework EBCDIC code page detection To detect EBCDIC code pages, we used to switch the encoding twice and had to be very careful not to decode data after the XML declaration before the second switch. This relied on a hard-coded expected size of the XML declaration and was complicated and unreliable. Now we convert the first 200 bytes to EBCDIC-US and parse the encoding declaration manually.
Nick Wellnhofer 1c5e1fc1 2023-02-14T13:56:21 malloc-fail: Check for malloc failure in xmlFindCharEncodingHandler Don't return encoding handlers with a NULL name. Found with libFuzzer, see #344.
Nick Wellnhofer d18f9c11 2023-02-14T13:50:46 malloc-fail: Fix leak of xmlCharEncodingHandler Also free handler if its name is NULL. Found with libFuzzer, see #344.
Nick Wellnhofer 3cc900f0 2023-02-16T11:50:52 encoding: Cast toupper argument to unsigned char Fixes undefined behavior. Also cast return value explicitly to fix implicit-integer-sign-change checks.
Nick Wellnhofer 2355eac5 2023-01-22T14:52:06 malloc-fail: Fix null deref if growing input buffer fails Also add some error checks. Found with libFuzzer, see #344.
Nick Wellnhofer 0f54af74 2022-12-08T18:36:45 encoding.c: Fix for documentation generator Top-level macro invocations throw off the documentation parser.
Nick Wellnhofer 53ab3840 2022-11-25T14:26:59 encoding: Make init function private
Nick Wellnhofer 3e9d5e4f 2022-11-25T14:19:36 encoding: Remove unused variable xmlDefaultCharEncodingHandler
Nick Wellnhofer 1406b20f 2022-11-24T19:14:33 encoding: Allocate default handlers statically
Nick Wellnhofer 2059df53 2022-11-14T22:27:58 buf: Deprecate static/immutable buffers
Nick Wellnhofer ad338ca7 2022-09-01T01:18:30 Remove explicit integer casts Remove explicit integer casts as final operation - in assignments - when passing arguments - when returning values Remove casts - to the same type - from certain range-bound values The main motivation is that these explicit casts don't change the result of operations and only render UBSan's implicit-conversion checks useless. Removing these casts allows UBSan to detect cases where truncation or sign-changes occur unexpectedly. Document some explicit casts as truncating and add a few missing ones.
Nick Wellnhofer 0f568c0b 2022-08-26T01:22:33 Consolidate private header files Private functions were previously declared - in header files in the root directory - in public headers guarded with IN_LIBXML - in libxml.h - redundantly in source files that used them. Consolidate all private header files in include/private.
David Kilzer c14cac8b 2022-05-25T18:13:07 xmlBufAvail() should return length without including a byte for NUL terminator * buf.c: (xmlBufAvail): - Return the number of bytes available in the buffer, but do not include a byte for the NUL terminator so that it is reserved. * encoding.c: (xmlCharEncFirstLineInput): (xmlCharEncInput): (xmlCharEncOutput): * xmlIO.c: (xmlOutputBufferWriteEscape): - Remove code that subtracts 1 from the return value of xmlBufAvail(). It was implemented inconsistently anyway.
David Kilzer 21561e83 2016-05-20T15:21:43 Mark more static data as `const` Similar to 8f5710379, mark more static data structures with `const` keyword. Also fix placement of `const` in encoding.c. Original patch by Sarah Wilkin.
Nick Wellnhofer 40483d0c 2022-03-06T13:55:48 Deprecate module init and cleanup functions These functions shouldn't be part of the public API. Most init functions are only thread-safe when called from xmlInitParser. Global variables should only be cleaned up by calling xmlCleanupParser.
Nick Wellnhofer f2072a8b 2022-03-05T18:23:34 Fix memory leak in xmlFindCharEncodingHandler Fix memory leak in an unlikely error condition. Thanks to Wentao Liang for the report. Fixes #342.
Nick Wellnhofer 21ddad52 2022-03-04T01:07:40 Remove ICONV_CONST test We can simply cast the offending pointer to (void *).
Nick Wellnhofer 776d15d3 2022-03-02T00:29:17 Don't check for standard C89 headers Don't check for - ctype.h - errno.h - float.h - limits.h - math.h - signal.h - stdarg.h - stdlib.h - string.h - time.h Stop including non-standard headers - malloc.h - strings.h
Nick Wellnhofer b66ce0bb 2022-03-01T12:39:02 Don't include ICU headers in public headers There's no need to make these implementation details public.
Nick Wellnhofer c41bc10d 2022-02-22T19:57:12 Fix unused variable warnings with disabled features
Nick Wellnhofer 346c3a93 2022-02-20T18:46:42 Remove elfgcchack.h The same optimization can be enabled with -fno-semantic-interposition since GCC 5. clang has always used this option by default.
Nick Wellnhofer 7abc6e6a 2022-01-25T02:27:53 Fix integer conversion warning in xmlIconvWrapper Use size_t for return value of iconv(3) to avoid an UBSan integer conversion warning.
Mohammad Razavi eb4c1bf8 2021-11-03T09:48:13 Fix random dropping of characters on dumping ASCII encoded XML Fix a bug in xmlCharEncOutput return value which will cause xmlNodeDumpOutput to drop characters randomly. xmlCharEncOutput returns zero if the length of the input buffer is zero but ignores the fact that it may already encoded the input buffer and the input's length is zero due to the fact that xmlEncOutputChunk returned -2 errors and underlying code tries to fix the error by encoding the input. xmlCharEncOutput is collecting the number of bytes written to the output buffer but is returning zero instead of the total number of bytes in this situation. This commit will fix this issue by returning the total number of bytes instead. So the xmlNodeDumpOutput will also continue writing and will not stop due to the fact that it mistakenly thinks the output buffer is not changed in that iteration. Fixes #314
David Kilzer 03bb9293 2021-07-07T18:23:18 Fix parse failure when 4-byte character in UTF-16 BE is split across a chunk This makes the logic in UTF16BEToUTF8() match UTF16LEToUTF8(). * encoding.c: (UTF16LEToUTF8): - Fix comment to describe what the code does. (UTF16BEToUTF8): - Fix undefined behavior which was applied to UTF16LEToUTF8() in 2f9382033e. - Add bounds check to while() loop which was applied to UTF16LEToUTF8() in be803967db. - Do not return -2 when (in >= inend) to fix the bug. This was applied to UTF16LEToUTF8() in 496a1cf592. - Inline (<< 8) statements to match UTF16LEToUTF8(). Add the following tests and results: test/text-4-byte-UTF-16-BE-offset.xml test/text-4-byte-UTF-16-BE.xml test/text-4-byte-UTF-16-LE-offset.xml test/text-4-byte-UTF-16-LE.xml
David King b92b16f6 2021-05-19T10:15:54 Remove unused variable in xmlCharEncOutFunc Fixes a compiler warning: encoding.c: In function 'xmlCharEncOutFunc__internal_alias': encoding.c:2632:9: warning: unused variable 'output' [-Wunused-variable] 2632 | int output = 0; https://gitlab.gnome.org/GNOME/libxml2/-/issues/254
Nick Wellnhofer dcb80b92 2021-02-20T20:30:43 Fix slow parsing of HTML with encoding errors Under certain circumstances, the HTML parser would try to guess and switch input encodings multiple times, leading to slow processing of documents with encoding errors. The repeated scanning of the input buffer when guessing encodings could even lead to quadratic behavior. The code htmlCurrentChar probably assumed that if there's an encoding handler, it is guaranteed to produce valid UTF-8. This holds true in general, but if the detected encoding was "UTF-8", the UTF8ToUTF8 encoding handler simply invoked memcpy without checking for invalid UTF-8. This still must be fixed, preferably by not using this handler at all. Also leave a note that switching encodings twice seems impossible to implement correctly. Add a check when handling UTF-8 encoding errors in htmlCurrentChar to avoid this situation, even if encoders produce invalid UTF-8. Found by OSS-Fuzz.
Xiaoming Ni 649d02ea 2020-12-07T20:19:53 encoding: fix memleak in xmlRegisterCharEncodingHandler() The return type of xmlRegisterCharEncodingHandler() is void. The invoker cannot determine whether xmlRegisterCharEncodingHandler() is executed successfully. when nbCharEncodingHandler >= MAX_ENCODING_HANDLERS, the "handler" is not added to the array "handlers". As a result, the memory of "handler" cannot be managed and released: memory leakage. so add "xmlfree(handler)" to fix memory leakage on the failure branch of xmlRegisterCharEncodingHandler(). Reported-by: wuqing <wuqing30@huawei.com> Signed-off-by: Xiaoming Ni <nixiaoming@huawei.com>
Frederik Seiffert b516ed18 2020-11-12T12:53:43 Fix building with ICU 68. ICU 68 no longer defines the TRUE macro. Closes #204.
Nick Wellnhofer 1e41e4fa 2020-06-30T02:43:57 Fix return values and documentation in encoding.c Make xmlEncInputChunk and xmlEncOutputChunk return 0 on success and never a positive value. Make xmlCharEncFirstLineInt, xmlCharEncFirstLineInt and xmlCharEncOutFunc return the number of bytes written.
Nick Wellnhofer 2f938203 2020-06-15T15:45:47 Fix undefined behavior in UTF16LEToUTF8 Don't perform arithmetic on null pointer. Found with libFuzzer and UBSan.
Nick Wellnhofer a697ed1e 2020-06-15T14:49:22 Fix return value of xmlCharEncOutput Commit 407b393d introduced a regression caused by xmlCharEncOutput returning 0 in case of success instead of the number of bytes written. Always use its return value for nbchars in xmlOutputBufferWrite. Fixes #166.
Nick Wellnhofer 20c60886 2020-03-08T17:19:42 Fix typos Resolves #133.
Jared Yanovich 2a350ee9 2019-09-30T17:04:54 Large batch of typo fixes Closes #109.
Andrey Bienkowski d2293cdb 2018-01-30T15:04:11 Remove a misleading line from xmlCharEncOutput Closes: https://bugzilla.gnome.org/show_bug.cgi?id=793028 It seams this line was accidentally copied over from xmlCharEncOutFunc. In xmlCharEncOutput output is a pointer so incrementing it by ret can point it where it wasn't supposed to be pointing. Luckily the current implementation doesn't dereference the pointer after advancing it. Signed-off-by: Daniel Veillard <veillard@redhat.com>
Nick Wellnhofer 772c0648 2017-11-09T17:56:31 Fix unused parameter warning without ICU
Joel Hockey 0b19f236 2017-10-25T18:11:12 Fixed ICU to set flush correctly and provide pivot buffer. By always setting flush=TRUE when doing multiple reads, ICU will not correctly handle truncated utf8 chars across read boundaries. The fix is to set flush=TRUE only on final read, and to provide a pivot buffer which is maintained by libxml between calls to ucnv_convertEx.
Nick Wellnhofer e5107772 2017-06-19T15:32:56 Fix pathological performance when outputting charrefs If a character can't be represented in the output encoding, it is converted to a character reference. This used to to replace the character in the input stream by calling xmlBufAddHead or xmlBufferAddHead. These functions shifted the entire input array around, leading to quadratic performance when converting a run of non-representable characters. This is most pronounced when dumping to memory. Output the charref directly instead. Found with libFuzzer.
Nick Wellnhofer c9ccbd6a 2017-06-19T14:57:43 Deduplicate code in encoding.c Introduce static functions xmlEncInputChunk and xmlEncOutputChunk that handle the internal/iconv/ICU branching.
David Kilzer 4472c3a5 2016-05-13T15:13:17 Fix some format string warnings with possible format string vulnerability For https://bugzilla.gnome.org/show_bug.cgi?id=761029 Decorate every method in libxml2 with the appropriate LIBXML_ATTR_FORMAT(fmt,args) macro and add some cleanups following the reports.
Gaurav 080a22c5 2013-11-29T23:10:50 Avoid a possibility of dangling encoding handler For https://bugzilla.gnome.org/show_bug.cgi?id=711149 In Function: int xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) If the freed handler is any one of handlers[i] list, then it will make that hanldlers[i] as dangling. This may lead to crash issues at places where handlers is read.
Denis Pauk e28c8a1a 2013-08-03T14:22:54 #705267 - add additional defines checks for support "./configure --with-minimum" https://bugzilla.gnome.org/show_bug.cgi?id=705267
Daniel Veillard bf058dce 2013-02-13T18:19:42 Fix the flushing out of raw buffers on encoding conversions https://bugzilla.gnome.org/show_bug.cgi?id=692915 the new set of converting functions tried to limit the encoding conversion of the raw buffer to the consumption one to work in a more progressive fashion. Unfortunately this was bad for performances and led to errors on progressive parsing when a very large chunk was close to the end of the document. Fix the new internal function and switch back to the old way of converting. Fix another bug in the process.
Petr Sumbera 6f49c73b 2012-12-12T15:41:30 Try IBM-037 when looking for EBCDIC handlers http://en.wikipedia.org/wiki/EBCDIC_037 as it is another variat of EBCDIC
Daniel Veillard f8e3db04 2012-09-11T13:26:36 Big space and tab cleanup Remove all space before tabs and space and tabs at end of lines.
Daniel Veillard 28cc42d0 2012-08-10T10:00:18 Regenerating docs and API files Various cleanups * configure.in: force regeneration of APIs in my environment * buf.c buf.h enc.h encoding.c include/libxml/tree.h include/libxml/xmlerror.h save.h tree.c: various comment cleanups pointed by apibuild * doc/apibuild.py: added the 3 new internal headers in the excludes * doc/libxml2-api.xml doc/libxml2-refs.xml: regenerated the API * doc/symbols.xml: listing new entry points for 2.9.0 * doc/devhelp/*: regenerated
Daniel Veillard 18d0db25 2012-07-13T19:51:15 Adding new encoding function to deal with the new structures * encoding.c: adds xmlCharEncFirstLineInput, xmlCharEncInput and xmlCharEncOutput * enc.h: the functions are not made public but added to this new header
Timothy Elliott 689408bd 2012-05-08T22:03:22 Prevent an infinite loop when dumping a node with encoding problems When a node is dumped with a new encoding, we may encounter characters that are not supported in the new encoding. libxml2 handles this by replacing the character with character references, but in some encodings this can result in an infinite loop when the character references themselves contain unsupported characters. This fixes the infinite loop by undoing a character reference substitution when it cannot be inserted, and returning an encoder error. This bug was noticed when looking into an infinite loop bug report for the Ruby Nokogiri project. The original bug report, "nokogiri process hangs on call to inner_html" is here: https://github.com/tenderlove/nokogiri/issues/400
Daniel Veillard 69f04562 2011-08-19T11:05:04 Fix an off by one error in encoding this off by one error doesn't seems to reproduce on linux but the error is real.
Giuseppe Iuculano 48f7dcb7 2010-11-04T17:42:42 480323 add code to plug in ICU converters by default This is not configured in by default but after some serious massaging incorporate that patch from Chromium/Chrome.
Daniel Veillard ad4f0a2d 2010-11-03T20:40:46 630140 better fix for iso995x encoding error Changing semantic of xmlCharEncInFunc() wasn't the proper way to do this, better change UTF8ToISO8859x() appropriately
Daniel Veillard 1cc912ec 2010-11-03T19:26:35 Various cleanups on encoding handling Done while chasing previous bug
Daniel Veillard 083caf5e 2010-11-03T19:24:05 630140 fix iso995x encoding error https://bugzilla.gnome.org/show_bug.cgi?id=630140 Fix the bug, which happen when using the embedded converters and not iconv
Daniel Veillard d44b9364 2009-09-07T12:15:08 A few more safety cleanup raised by scan * SAX2.c encoding.c parser.c xmlschemas.c: a few more safety checks * relaxng.c: remove an unused intitialization
Daniel Veillard 76d36458 2009-09-07T11:19:33 Fixing assorted potential problems raised by scan * encoding.c parser.c relaxng.c runsuite.c tree.c xmlreader.c xmlschemas.c: nothing really serious but better safe than sorry
Daniel Veillard 7e385bd4 2009-08-26T11:38:49 566012 autodetected encoding and encoding conflict * encoding.c parser.c parserInternals.c: when we autodetect an encoding but it's actually not completely compatible with the one declared great care must be taken to not convert more than just the first line. Led to some refactoring, more private functions and a bit of cleanup.
Martin Kögler c78988ac 2009-08-24T16:47:48 566012 Incomplete EBCDIC parsing support * encoding.c: the iconv converter is sometimes only found as "EBCDIC-US"
Daniel Veillard e83e93e7 2008-08-30T12:52:26 make a new kind of buffer where shrinking and adding in head can avoid * include/libxml/tree.h tree.c: make a new kind of buffer where shrinking and adding in head can avoid reallocation or full buffer memmoves * encoding.c xmlIO.c: use the new kind of buffers for output buffers Daniel svn path=/trunk/; revision=3787
Daniel Veillard f124539f 2008-04-03T09:46:34 buffer may not be large enough to convert to UCS4, patch from Christian * encoding.c: buffer may not be large enough to convert to UCS4, patch from Christian Fruth , fixes #504015 Daniel svn path=/trunk/; revision=3727