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 — src: warn about odd UTF-16 decoding function signature · nodejs/node@f064d44

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node.h
    • string_bytes.h
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node.h‎

Copy file name to clipboardExpand all lines: src/node.h
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,8 @@ NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
424424
size_t len,
425425
enum encoding encoding = LATIN1);
426426

427-
// The input buffer should be in host endianness.
427+
// Warning: This reverses endianness on Big Endian platforms, even though the
428+
// signature using uint16_t implies that it should not.
428429
NODE_EXTERN v8::Local<v8::Value> Encode(v8::Isolate* isolate,
429430
const uint16_t* buf,
430431
size_t len);
Collapse file

‎src/string_bytes.h‎

Copy file name to clipboardExpand all lines: src/string_bytes.h
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,10 @@ class StringBytes {
9797
enum encoding encoding,
9898
v8::Local<v8::Value>* error);
9999

100-
// The input buffer should be in host endianness.
100+
// Warning: This reverses endianness on BE platforms, even though the
101+
// signature using uint16_t implies that it should not.
102+
// However, the brokenness is already public API and can't therefore
103+
// be changed easily.
101104
static v8::MaybeLocal<v8::Value> Encode(v8::Isolate* isolate,
102105
const uint16_t* buf,
103106
size_t buflen,

0 commit comments

Comments
0 (0)
You are visitor 01402775 — 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.