Re: [xml] Patch to fix ICU flush and pivot buffer



On 25/10/2017 10:32, Joel Hockey wrote:
This patch fixes those issues.

Looks good.

The patch changes public function xmlCharEncInFunc but this function isn't used internally anymore (since commit a78d8036 from 2012). It might still be used in client code that wants to use libxml2's character conversion facilities, though. Maybe it's better to remove the `flush` parameter and always call xmlEncInputChunk with `flush` set to 1. This should at least allow one-shot character conversions without breaking the public API.

The test sets encoding to "UTF8-".  This encoding is chosen since it is not recognized by libxml and forces the decoding to be done by ICU which recognizes this encoding as UTF8.  Unfortunately, the test always fails when using iconv since iconv does not recognize this encoding.  Since iconv is the default in libxml, I understand that it may not make sense to always run this testcase, or to include it at all.

It should be possible to write a test that works with both iconv and ICU and triggers the bug with a different variable-width encoding like Shift-JIS.

If it is any help, I can send this patch as a pull request to the libxml github repo, or I can also create a libxml bug.  It looks like libxml preference is to take patches on the mailing list.

I prefer patches created with `git format-patch` that include author information and a commit message, either via the mailing list or Bugzilla.

Nick


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]