Page MenuHomeFreeBSD

libc: iconv: add mb_cur_min for encoder traits

Authored by kevans on Feb 22 2022, 5:25 PM.
Referenced Files
Unknown Object (File)
Tue, May 14, 12:43 AM
Unknown Object (File)
Sat, May 11, 11:27 AM
Unknown Object (File)
Wed, May 8, 10:25 AM
Unknown Object (File)
Mon, May 6, 8:53 AM
Unknown Object (File)
Apr 18 2024, 4:14 PM
Unknown Object (File)
Apr 9 2024, 5:43 AM
Unknown Object (File)
Apr 8 2024, 10:51 PM
Unknown Object (File)
Feb 9 2024, 9:57 PM



A future commit will actually implement //IGNORE so that applications
using base iconv can, e.g., sanitize UTF-8 strings. To do this, the
iconv_std module needs to be able to determine the minimum width for any
given encoding so that it can skip that many bytes in the input buffer.
This is mainly an issue for UTF-16 and UTF-32.

This commit bumps shlib versions to 5 for libiconv modules to reflect
the ABI change. It also fixes OptionalObsoleteFiles to remove the
libiconv modules if WITHOUT_ICONV is in use.

Sponsored by: Klara, Inc.

Diff Detail

rG FreeBSD src repository
Lint Not Applicable
Tests Not Applicable

Event Timeline

thj added inline comments.

I can't track down the resolution of encoding info. This define always being one seems to exclude the 'otherwise specified' part of the comment, is the minimum changed somewhere else?


These are all kind of whacky, but this file is actually part of the module template and only gets #include'd at the bottom of a module.c, so the module is free to #define it and we'll use that instead below. The below methods are declared in the module's .h, which is what libiconv uses.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 29 2022, 11:22 PM
This revision was automatically updated to reflect the committed changes.