Skip to content

crypto: fix ucs2/ucs-2/utf16le/utf-16le encoding check

Rodrigo Muino Tomonari requested to merge github/fork/atstoyanov/cryptofix into master
Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

crypto

Description of change

Normalize the encoding in getDecoder() before using it. Fixes an AssertionError: "Cannot change encoding" when encoding is "ucs2", "ucs-2" or "utf-16le"

Fixes: https://github.com/nodejs/node/issues/8236

Merge request reports

Loading