Skip to content

Tolerate duplicate iconv aliases on macOS - #81

Open
pnavais wants to merge 1 commit into
rrthomas:masterfrom
pnavais:fix/darwin-iconv-duplicate-aliases
Open

pnavais wants to merge 1 commit into
rrthomas:masterfrom
pnavais:fix/darwin-iconv-duplicate-aliases

Conversation

@pnavais

@pnavais pnavais commented Sep 28, 2026

Copy link
Copy Markdown

On macOS, iconv -l lists some charset aliases under more than one group. In particular, WINDOWS-874 appears with both CP1162 and CP874. When tables.py turns that listing into iconvdecl.h, module_iconv then tries to declare the same alias for two different charsets and aborts initialization with a contradiction error. That makes the check phase fail on aarch64-darwin (and likely x86_64-darwin as well).

This change:

  1. In tables.py, when digesting iconv -l, keep only the first occurrence of each alias name.
  2. In module_iconv, if an alias is already bound to a different charset, keep the existing binding instead of failing.

Verified on aarch64-darwin with recode 3.7.16: 488 good tests.

macOS libiconv lists some names (e.g. WINDOWS-874) under more than one
charset group. Treat the first binding as authoritative so module_iconv
initialization no longer fails during the check phase on Darwin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant