Skip to content

Test failure: parallel/test-icu-transcode.js #1

Closed
@hashseed

Description

@hashseed

When transcoding from UTF8 to Latin1, we create a new node::Converter for "iso8859-1".
The call chain goes:

  • node::Converter
  • ucnv_open
  • ucnv_createConverter
  • ucnv_loadSharedData
  • ucnv_io_getConverterName

This is where the version of ICU included in Node.js and the one in Chromium differs. The former returns nullptr, whereas the latter returns "windows-1252-html"

"windows-1252-html" is a superset of "iso8859-1" that includes the EURO sign, which is tested in this particular test:

const orig = Buffer.from('tést €', 'utf8');

Since the EURO sign fits into "windows-1252-html", we do not need to resort to the substitution character ("?"). That's why the test fails.

The reason Node's ICU fails is this call chain:

  • ucnv_io_getConverterName
  • haveAliasData
  • initAliasData
  • udata_openChoice

Chromium's ICU returns a valid UDataMemory* object, but Node's ICU returns a nullptr.

I'm unsure whether this is a bug in Node.js.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions