Skip to content

Conversation

@bjohansebas
Copy link
Member

@bjohansebas bjohansebas commented Aug 18, 2025

I plan to release this version on Wednesday, 8/20/2025

🐞 Bug fixes

  • Handle split surrogate pairs when encoding utf8 - by @yosion-p and @ashtuchkin in #282:

    Handle a case where streaming utf8 encoder (converting js strings -> buffers) encounters
    surrogate pairs split between chunks (last character of one chunk is high surrogate and first
    character of the next chunk is a low surrogate).

  • Avoid false positives in encodingExists by using objects without a prototype - by @bjohansebas in #328

    The encodingExists method could return incorrect results if the lookup matched properties inherited
    from the prototype of the object that stores the encodings, such as constructor and others. This change
    replaces that object with one that has no prototype, ensuring that only explicitly defined valid encodings
    in the library are considered. In addition, the fix is applied to the internal cache system to avoid the same
    kind of false positives

🚀 Improvements

  • Make explicit that decode() method supports Uint8Array input - by @jardicc in #271
  • Remove compatibility check for StringDecoder.end method - by @bjohansebas in #331

Other changes

Full Changelog: v0.6.3...master

Signed-off-by: Sebastian Beltran <[email protected]>
@coveralls

This comment was marked as off-topic.

This comment was marked as off-topic.

Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah! Great work!

surrogate pairs split between chunks (last character of one chunk is high surrogate and first
character of the next chunk is a low surrogate).

* Avoid false positives in encodingExists by using objects without a prototype - by [@bjohansebas](https://github.com/bjohansebas) in [#328](https://github.com/ashtuchkin/iconv-lite/pull/328)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed we pulled in object-assign in this PR, wdyt think about using Object.assign directly instead since this is effectively a major release (no one will automatically upgrade to 0.7). This would make the min node version v4, but it might be worth bumping it higher if you go down that route.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I remember, npm didn’t fully follow semver for version 0.x.x, which is why some of the old support for using Object.assign hadn’t been removed. But after doing some more research, it seems these changes can be made since npm does respect it. I’m going to open a PR for that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, since raw-body and qs won't be able to update, legacy support will be maintained.

@bjohansebas
Copy link
Member Author

bjohansebas commented Aug 19, 2025

I will do the release after the repository has been transferred to the GitHub organization, or if the transfer happens before Wednesday, then I’ll wait until Wednesday.

Copy link

@Phillip9587 Phillip9587 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am against dropping Node.js support for older versions. This release would not help body-parser because raw-body has iconv-lite pinned to version 0.6.3. That would still result in multiple versions of iconv-lite in our dependency tree.
Since raw-body supports Node.js >= 0.8, it cannot update iconv-lite after we drop previously supported Node.js versions. However, if we keep Node.js support unchanged, raw-body could simply update the version.

@bjohansebas
Copy link
Member Author

@Phillip9587 Unfortunately, raw-body will not be able to update by re-adding support for Node <6. This package, in version 0.6, does not support Node 0.8, and basically, this is a new major version (re-adding more support for Node 0.8 is not an option). raw-body will need to release a new major version to remove that support and be able to update, along with other changes

@Phillip9587
Copy link

@bjohansebas raw-body 3.0.0-beta.1 dropped support for Node.js < 0.10 but they forgot to update the engines field (raw-body/HISTORY.md and stream-utils/raw-body#92). So leaving the Node.js support the same as in iconv-lite 0.6 (which supports Node.js >= 0.10) would allow raw-body to bump the iconv-lite version without a major release.

I'm not saying that we shouldn't drop support I'm saying that we have to consider dropping the support because raw-body is not maintained by the express team as far as i know.

@bjohansebas
Copy link
Member Author

Yep, it’s not maintained by Express, but anyway, even though they said they only support Node >0.10, they didn’t update the engines field (the same problem we have in other packages), so in reality, raw-body still supports Node 0.8.

Copy link
Member

@UlisesGascon UlisesGascon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to update the engines in the pkg, right? Then is also considered as major (ref)

Copy link
Contributor

@ashtuchkin ashtuchkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! My only minor concern is adding object-assign dependency instead of just writing a for loop, but I guess we'll remove both that and safer-buffer when we remove Node v6 support someday.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 17103991048

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 93.874%

Totals Coverage Status
Change from base Build 17102863786: 0.0%
Covered Lines: 950
Relevant Lines: 1012

💛 - Coveralls

@bjohansebas bjohansebas merged commit 165af71 into master Aug 20, 2025
59 checks passed
@bjohansebas bjohansebas deleted the 0.7.0 branch August 20, 2025 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants