Skip to content

feat: support iso-8859-8-i and iso-8859-8-e charset labels#394

Open
baptistejamin wants to merge 2 commits into
pillarjs:masterfrom
baptistejamin:feat/iso-8859-8-i
Open

feat: support iso-8859-8-i and iso-8859-8-e charset labels#394
baptistejamin wants to merge 2 commits into
pillarjs:masterfrom
baptistejamin:feat/iso-8859-8-i

Conversation

@baptistejamin

Copy link
Copy Markdown

Hey there.

iconv-lite is used by a library we rely on: mailparser, which we use at Crisp.

We've received Hebrew emails with charset="iso-8859-8-i", and they aren't decoded properly by iconv-lite.

Right now, encodingExists('iso-8859-8-i') returns false and decode(buf, 'iso-8859-8-i') throws Encoding not recognized.

iso-8859-8-i and iso-8859-8-e are valid ISO charset names. The -i / -e suffix only describes text directionality (logical vs. visual BiDi order).

What this PR does

  • Adds iso88598i and iso88598e as aliases of iso88598 in encodings/sbcs-data.js, next to the existing hebrew / csisolatinhebrew aliases.
  • The canonicalizer in lib/index.js already strips the dashes (iso-8859-8-iiso88598i), so both the dashed header form and the canonical form now resolve correctly.
  • Regenerates types/encodings.d.ts
  • Updated tests

The code was partially written with Cursor and Opus 4.8, and I reviewed it myself; it's an easy and safe PR.

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