Skip to content

Commit

Permalink
buffer: don't use Fast API for utf8
Browse files Browse the repository at this point in the history
Fast API handles invalid UTF differently than the slow API.

Fixes: #54521
  • Loading branch information
ronag committed Aug 23, 2024
1 parent d5dc540 commit caf876b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1564,11 +1564,12 @@ void Initialize(Local<Object> target,
"latin1WriteStatic",
SlowWriteString<LATIN1>,
&fast_write_string);
SetFastMethod(context,
target,
"utf8WriteStatic",
SlowWriteString<UTF8>,
&fast_write_string);
// SetFastMethod(context,
// target,
// "utf8WriteStatic",
// SlowWriteString<UTF8>,
// &fast_write_string);
SetMethod(context, target, "utf8WriteStatic", SlowWriteString<UTF8>);

SetMethod(context, target, "getZeroFillToggle", GetZeroFillToggle);
}
Expand Down

0 comments on commit caf876b

Please sign in to comment.