Title: buffer.indexOf is incorrect in utf16le encoding for odd byteOffset · Issue #26448 · nodejs/node · GitHub
Open Graph Title: buffer.indexOf is incorrect in utf16le encoding for odd byteOffset · Issue #26448 · nodejs/node
X Title: buffer.indexOf is incorrect in utf16le encoding for odd byteOffset · Issue #26448 · nodejs/node
Description: Version: v11.10.1 Platform: Windows 10 (64-bits) Subsystem: buffer File Encoding: UTF8 Please consider the following 2 lines of code: let buf = Buffer.from('\u6881\u6882\u6881', 'utf16le'); console.log(buf.indexOf('\u6881', 1, 'utf16le')...
Open Graph Description: Version: v11.10.1 Platform: Windows 10 (64-bits) Subsystem: buffer File Encoding: UTF8 Please consider the following 2 lines of code: let buf = Buffer.from('\u6881\u6882\u6881', 'utf16le'); console...
X Description: Version: v11.10.1 Platform: Windows 10 (64-bits) Subsystem: buffer File Encoding: UTF8 Please consider the following 2 lines of code: let buf = Buffer.from('\u6881\u6882\u6881', 'utf16l...
Opengraph URL: https://github.com/nodejs/node/issues/26448
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"buffer.indexOf is incorrect in utf16le encoding for odd byteOffset","articleBody":"Version: v11.10.1\r\nPlatform: Windows 10 (64-bits)\r\nSubsystem: buffer\r\nFile Encoding: UTF8\r\n\r\nPlease consider the following 2 lines of code:\r\nlet buf = Buffer.from('\\u6881\\u6882\\u6881', 'utf16le');\r\nconsole.log(buf.indexOf('\\u6881', 1, 'utf16le'));\r\n\r\nIn this example, the expected correct output should be 4.\r\nHowever, the result is 0.","author":{"url":"https://github.com/hkjackey","@type":"Person","name":"hkjackey"},"datePublished":"2019-03-05T08:00:07Z","url":"https://github.com/nodejs/node/issues/26448"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1e311091-1100-3d44-15d9-52eb1f6df92a |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B1D2:4CC9:5102C1:6DC742:6AED2678 |
| html-safe-nonce | d8dd072faacaa6a6b08b8cb56ada8ab70375460d5b884afb959aa07ccbe56dbb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMUQyOjRDQzk6NTEwMkMxOjZEQzc0Mjo2QUVEMjY3OCIsInZpc2l0b3JfaWQiOiI5MTc2NTAyNzkxNDE5Mjc0ODcyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 7fbe87ecc996feb00cbfc18b0ebe8244a2f8abf5f75533062ecd8a93f8942697 |
| hovercard-subject-tag | issue:417165115 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/26448/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2adfc911d0339b08a312890b06d28844c10faac9901ae3989522acf3c1542f9f/nodejs/node/issues/26448 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2adfc911d0339b08a312890b06d28844c10faac9901ae3989522acf3c1542f9f/nodejs/node/issues/26448 |
| og:image:alt | Version: v11.10.1 Platform: Windows 10 (64-bits) Subsystem: buffer File Encoding: UTF8 Please consider the following 2 lines of code: let buf = Buffer.from('\u6881\u6882\u6881', 'utf16le'); console... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | hkjackey |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9d95365dda0576efe9b71f45807595e396bd0ca9286fba5367a05048e6ddf8f2 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 98b41fa4b5635ceb45a4c54320fced73817ff290 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width