mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
Addresses CodeRabbit review feedback:
**Issue**: ucs2 and utf16le were not being treated as equivalent aliases,
causing transcode("utf16le", "ucs2") to fail with "Unsupported encoding
combination" error.
**Fix**:
- Normalize ucs2 to utf16le before processing
- This ensures the same-encoding fast path works for both aliases
- All switch cases now treat them identically
- Removed ucs2 from supported encoding checks (redundant after normalization)
**Tests Added**:
- utf16le → ucs2 transcoding
- ucs2 → utf16le transcoding
- ucs2 → utf8 transcoding
All tests pass (22 custom + Node.js compatibility).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>