GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: add buffer.isUtf8 for utf8 validation by anonrig · Pull Request #45947 · nodejs/node

Conversation

@anonrig

@anonrig anonrig commented Dec 22, 2022 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

With the introduction of simdutf, we can finally have a fast way of validating utf-8 on the userland. This pull request introduces buffer.isUtf8.

This was initially requested by @KhafraDev while implementing undici websockets.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

KhafraDev and bricss reacted with heart emoji addaleax and Siddhant-K-code reacted with rocket emoji lemire and bricss reacted with eyes emoji
All reactions
  • ❤️ 2 reactions
  • 🚀 2 reactions
  • 👀 2 reactions
@nodejs-github-bot nodejs-github-bot added buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Dec 22, 2022
@anonrig anonrig mentioned this pull request Dec 22, 2022
src: add node:encoding module #45823
Closed
4 tasks
@anonrig
buffer: add buffer.isUtf8 for utf8 validation
be10b36
@anonrig
anonrig force-pushed the feat/add-is-utf8 branch from ef35908 to be10b36 Compare December 22, 2022 21:25
@anonrig

anonrig commented Dec 22, 2022

Copy link
Copy Markdown
Member Author

CC @nodejs/buffer @nodejs/performance @nodejs/undici

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lpinca
lpinca reviewed Dec 22, 2022
View reviewed changes
Comment thread lib/buffer.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

RafaelGSS
RafaelGSS reviewed Dec 22, 2022
View reviewed changes
Comment thread src/node_buffer.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

KhafraDev
KhafraDev reviewed Dec 22, 2022
View reviewed changes
Comment thread lib/buffer.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

ronag
ronag approved these changes Dec 23, 2022
View reviewed changes
@targos

targos commented Dec 23, 2022

Copy link
Copy Markdown
Member

Can you add a test with a detached array buffer ?

anonrig reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lpinca
lpinca reviewed Dec 23, 2022
View reviewed changes
Comment thread doc/api/buffer.md Resolved

Uh oh!

There was an error while loading. Please reload this page.

lpinca
lpinca reviewed Dec 23, 2022
View reviewed changes
Comment thread lib/buffer.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

mcollina
mcollina approved these changes Dec 23, 2022
View reviewed changes

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

lgtm

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
bnoordhuis
bnoordhuis reviewed Dec 23, 2022
View reviewed changes
Comment thread src/node_buffer.cc Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/parallel/test-buffer-isutf8.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@anonrig
fixup! buffer: add buffer.isUtf8 for utf8 validation
bcb19ec
@anonrig
anonrig requested review from KhafraDev, RafaelGSS, bnoordhuis, lpinca and targos and removed request for KhafraDev December 23, 2022 17:34
@anonrig anonrig added request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. author ready PRs with CI started, the required approvals, and no outstanding review comments. notable-change PRs with changes that should be highlighted in changelogs. labels Dec 23, 2022
lpinca
lpinca approved these changes Dec 23, 2022
View reviewed changes
Comment thread test/parallel/test-buffer-isutf8.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/parallel/test-buffer-isutf8.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread test/parallel/test-buffer-isutf8.js Resolved

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Dec 23, 2022
@github-actions github-actions Bot mentioned this pull request Jan 2, 2023
CI Reliability 2023-01-02 nodejs/reliability#476
Open
22 tasks
@RafaelGSS RafaelGSS mentioned this pull request Jan 2, 2023
v19.4.0 proposal #46061
Merged
RafaelGSS added a commit that referenced this pull request Jan 2, 2023
@RafaelGSS
2023-01-03, Version 19.4.0 (Current)
fd77454
Notable changes:

buffer:
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
deps:
  * disable avx512 for simutf on benchmark ci (Yagiz Nizipli) #45803
  * add simdutf dependency (Yagiz Nizipli) #45803
http:
  * (SEMVER-MINOR) improved timeout defaults handling (Paolo Insogna) #45778
net
  * add autoSelectFamily global getter and setter (Paolo Insogna) #45777
os:
  * (SEMVER-MINOR) add availableParallelism() (Colin Ihrig) #45895
util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46061
RafaelGSS added a commit that referenced this pull request Jan 2, 2023
@RafaelGSS
2023-01-03, Version 19.4.0 (Current)
3d55e4b
Notable changes:

buffer:
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
deps:
  * disable avx512 for simutf on benchmark ci (Yagiz Nizipli) #45803
  * add simdutf dependency (Yagiz Nizipli) #45803
http:
  * (SEMVER-MINOR) improved timeout defaults handling (Paolo Insogna) #45778
net
  * add autoSelectFamily global getter and setter (Paolo Insogna) #45777
os:
  * (SEMVER-MINOR) add availableParallelism() (Colin Ihrig) #45895
util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46061
@github-actions github-actions Bot mentioned this pull request Jan 3, 2023
CI Reliability 2023-01-03 nodejs/reliability#477
Open
23 tasks
RafaelGSS pushed a commit that referenced this pull request Jan 4, 2023
@anonrig @RafaelGSS
buffer: add buffer.isUtf8 for utf8 validation
fd33718
PR-URL: #45947
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
RafaelGSS added a commit that referenced this pull request Jan 4, 2023
@RafaelGSS
2023-01-05, Version 19.4.0 (Current)
790cc5b
Notable changes:

buffer:
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
http:
  * (SEMVER-MINOR) improved timeout defaults handling (Paolo Insogna) #45778
net
  * add autoSelectFamily global getter and setter (Paolo Insogna) #45777
os:
  * (SEMVER-MINOR) add availableParallelism() (Colin Ihrig) #45895
util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46061
RafaelGSS pushed a commit that referenced this pull request Jan 5, 2023
@anonrig @RafaelGSS
buffer: add buffer.isUtf8 for utf8 validation
fbe399c
PR-URL: #45947
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
RafaelGSS added a commit that referenced this pull request Jan 5, 2023
@RafaelGSS
2023-01-05, Version 19.4.0 (Current)
b181545
Notable changes:

buffer:
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
http:
  * (SEMVER-MINOR) improved timeout defaults handling (Paolo Insogna) #45778
net
  * add autoSelectFamily global getter and setter (Paolo Insogna) #45777
os:
  * (SEMVER-MINOR) add availableParallelism() (Colin Ihrig) #45895
util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46061
RafaelGSS added a commit that referenced this pull request Jan 5, 2023
@RafaelGSS
2023-01-06, Version 19.4.0 (Current)
e58ed6d
Notable changes:

buffer:
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
http:
  * (SEMVER-MINOR) improved timeout defaults handling (Paolo Insogna) #45778
net
  * add autoSelectFamily global getter and setter (Paolo Insogna) #45777
os:
  * (SEMVER-MINOR) add availableParallelism() (Colin Ihrig) #45895
util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46061
RafaelGSS added a commit that referenced this pull request Jan 6, 2023
@RafaelGSS
2023-01-06, Version 19.4.0 (Current)
22a2ec6
Notable changes:

buffer:
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
http:
  * (SEMVER-MINOR) improved timeout defaults handling (Paolo Insogna) #45778
net
  * add autoSelectFamily global getter and setter (Paolo Insogna) #45777
os:
  * (SEMVER-MINOR) add availableParallelism() (Colin Ihrig) #45895
util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46061
bentley1985
bentley1985 reviewed Jan 7, 2023
View reviewed changes

@bentley1985 bentley1985 left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
juanarbol pushed a commit that referenced this pull request Jan 26, 2023
@anonrig @juanarbol
buffer: add buffer.isUtf8 for utf8 validation
907068c
PR-URL: #45947
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
@juanarbol juanarbol mentioned this pull request Jan 28, 2023
V18.14.0 proposal #46396
Merged
juanarbol added a commit that referenced this pull request Jan 28, 2023
@juanarbol
2023-01-31, Version 18.14.0 'Hydrogen' (LTS)
614a60d
Notable changes:

* buffer
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
* deps:
  * disable avx512 for simutf on benchmark ci (Yagiz Nizipli) #45803
  * add simdutf dependency (Yagiz Nizipli) #45803
  * upgrade npm to 9.1.3 (npm team) #45693
* util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46396
juanarbol added a commit that referenced this pull request Jan 30, 2023
@juanarbol
2023-01-31, Version 18.14.0 'Hydrogen' (LTS)
53ddd3a
Notable changes:

* buffer
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
* deps:
  * add simdutf dependency (Yagiz Nizipli) #45803
  * upgrade npm to 9.1.3 (npm team) #45693
* util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46396
juanarbol pushed a commit that referenced this pull request Jan 31, 2023
@anonrig @juanarbol
buffer: add buffer.isUtf8 for utf8 validation
16ee02f
PR-URL: #45947
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rafael Gonzaga <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
juanarbol added a commit that referenced this pull request Jan 31, 2023
@juanarbol
2023-01-31, Version 18.14.0 'Hydrogen' (LTS)
a413280
Notable changes:

* buffer
  * (SEMVER-MINOR) add buffer.isUtf8 for utf8 validation (Yagiz Nizipli) #45947
* deps:
  * add simdutf dependency (Yagiz Nizipli) #45803
  * upgrade npm to 9.1.3 (npm team) #45693
* util:
  * add fast path for text-decoder fatal flag (Yagiz Nizipli) #45803

PR-URL: #46396
@BethGriggs BethGriggs mentioned this pull request Feb 3, 2023
Confusion around semver-minor commits nodejs/Release#820
Closed
@Archkon Archkon mentioned this pull request Jul 14, 2026
buffer: isUtf8 and isAscii accept detached TypedArray views #64503
Closed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 4, 2026
chore: upgrade Trellis dogfood to 0.6.12 mindfold-ai/Trellis#520
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lemire lemire lemire left review comments
@jasnell jasnell jasnell left review comments
@lpinca lpinca lpinca approved these changes
@KhafraDev KhafraDev KhafraDev left review comments
@mcollina mcollina mcollina approved these changes
@addaleax addaleax addaleax approved these changes
@ronag ronag ronag approved these changes
@RafaelGSS RafaelGSS RafaelGSS approved these changes
@targos targos Awaiting requested review from targos
@bnoordhuis bnoordhuis Awaiting requested review from bnoordhuis
+1 more reviewer
@bentley1985 bentley1985 bentley1985 left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. buffer Issues and PRs related to the buffer subsystem. c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

13 participants

@anonrig @targos @nodejs-github-bot @mcollina @bnoordhuis @lemire @jasnell @addaleax @lpinca @ronag @RafaelGSS @KhafraDev @bentley1985
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.