testchar.c

Branch


Log

Author Commit Date CI Message
Nick Wellnhofer 43f7ff0a 2025-08-01T15:27:11 tests: Make global variables static
Nick Wellnhofer b0234633 2025-05-13T20:19:39 encoding: Preserve original encoding label When using built-in encodings, the label would be normalized which causes various issues. We now create a copy of the handler with the original name. This is somewhat dangerous as it will require users to free built-in encodings with xmlCharEncCloseFunc. But to handle the general case, this was already required. Fixes #916 in another way than originally proposed.
Nick Wellnhofer f7c41287 2025-05-02T15:57:17 doc: Remove more comment block headers
Nick Wellnhofer 0f4f8900 2024-11-17T20:13:14 parser: Rename inputPush to xmlCtxtPushInput
Nick Wellnhofer 10082a3d 2024-07-04T03:35:17 testchar: Don't invoke encoding handler directly
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 712a31ab 2024-06-10T23:06:13 parser: Deprecate most public struct members This will probably cause many warnings in downstream code abusing libxml2 internals, but we can always undeprecate some members later.
Nick Wellnhofer 8d0aaf4b 2023-12-19T20:47:36 parser: Remove xmlErrEncoding Use xmlFatalErr or xmlCtxtErrIO.
Nick Wellnhofer c2bbeed1 2023-12-12T23:51:32 io: Fix memory lifetime issue with input buffers xmlParserInputBufferCreateMem must make a copy of the buffer. This fixes a regression from 2.11 which could cause reads from freed memory depending on the use case. Undeprecate xmlParserInputBufferCreateStatic which can avoid copying the whole buffer.
Nick Wellnhofer 61034116 2023-10-24T15:02:36 error: Make more xmlError structs constant Prepare for future changes, see 45470611.
Nick Wellnhofer 5221fcd4 2023-10-22T16:32:08 tests: Also test xmlNextChar in testchar.c
Nick Wellnhofer 02856674 2023-10-22T15:56:46 parser: Remove redundant IS_CHAR check in xmlCurrentChar
Nick Wellnhofer a0462e2d 2023-08-08T15:19:49 test: Add push parser test with overridden encoding After recent changes, it should work to call xmlSwitchEncoding to override the encoding for the push parser. This was never properly supported, so Chromium and WebKit added a hack to reset the encoding in the startDocument SAX handler.
Nick Wellnhofer ec7be506 2023-08-08T15:19:46 parser: Rework encoding detection Introduce XML_INPUT_HAS_ENCODING flag for xmlParserInput which is set when xmlSwitchEncoding is called. The parser can use the flag to reliably detect whether an encoding was already set via user override, BOM or other auto-detection. In this case, the encoding declaration won't be used to switch the encoding. Before, an inscrutable mix of ctxt->charset, ctxt->input->encoding and ctxt->input->buf->encoder was used. Introduce private helper functions to switch encodings used by both the XML and HTML parser: - xmlDetectEncoding which skips over the BOM, allowing to remove the BOM checks from other encoding functions. - xmlSetDeclaredEncoding, replacing htmlCheckEncodingDirect, which warns about encoding mismatches. If users override the encoding, store the declared instead of the actual encoding in xmlDoc. In this case, the actual encoding is known and the raw value from the doc is more useful. Also use the input flags to store the ISO-8859-1 fallback state. Restrict the fallback to cases where no encoding was specified. (The fallback is only useful in recovery mode and these days broken UTF-8 is probably more likely than ISO-8859-1, so it might eventually be removed completely.) The 'charset' member of xmlParserCtxt is now unused. The 'encoding' member of xmlParserInput is now unused. The 'standalone' member of xmlParserInput is renamed to 'flags'. A new parser state XML_PARSER_XML_DECL is added for the push parser.
Nick Wellnhofer 981093ab 2023-05-18T19:23:58 test: Add push parser tests for split UTF-8 sequences
Nick Wellnhofer 886bf4e6 2023-04-30T15:35:47 Stop calling xmlMemoryDump This was used to check for memory leaks but could potentially create a .memdump file. These days, there are better ways to check for memory leaks.
Nick Wellnhofer 3ffcc03b 2023-03-13T19:38:41 parser: Deprecate more internal functions
Nick Wellnhofer b51b99ef 2023-04-21T02:56:10 testchar: Fix return value in testUserEncoding
Nick Wellnhofer eca1116b 2023-04-20T13:52:16 testchar: Add test for memory pull parser with encoding
Nick Wellnhofer 59b33661 2022-12-27T14:15:51 error: Limit number of parser errors Reporting errors is expensive and some abusive test cases can generate an error for each invalid input byte. This causes the parser to spend most of the time with error handling. Limit the number of errors and warnings to 100.
Nick Wellnhofer 2059df53 2022-11-14T22:27:58 buf: Deprecate static/immutable buffers
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.
Tony Tascioglu 41a19430 2022-04-03T17:54:23 Make testchar return an error on failure
Nick Wellnhofer 5948abfe 2022-01-25T01:59:03 Add explicit casts in testchar.c Avoids integer conversion warnings with UBSan.
Jared Yanovich 2a350ee9 2019-09-30T17:04:54 Large batch of typo fixes Closes #109.
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 145477d8 2012-07-16T14:59:29 Swicth the test program for characters to new input buffers it was manipulating the buffer content and structures directly this cleans it up
Daniel Veillard abade013 2008-07-24T15:05:38 add a new regression test program for testing character ranges and UTF8 * Makefile.am testchar.c Makefile.tests README.tests: add a new regression test program for testing character ranges and UTF8 encoding/decoding Daniel svn path=/trunk/; revision=3754