TextEncoder, TextDecoder
See original GitHub issueI typically do:
const {TextEncoder, TextDecoder} = require('util')
but now I’m building a React Native app and had to actually install this package npm i util
, however the methods above I see are missing. where can I get them from and why are they not included in this package?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:6 (2 by maintainers)
Top Results From Across the Web
TextDecoder and TextEncoder - The Modern JavaScript Tutorial
The built-in TextDecoder object allows one to read the value into an actual JavaScript string, given the buffer and the encoding. We first...
Read more >TextEncoder - Web APIs - MDN Web Docs
Chrome Edge
TextEncoder Full support. Chrome38. Toggle history Full support. Edge79. To...
TextEncoder() constructor Full support. Chrome38. Toggle history Full support. Edge79. To...
encode Full support....
Read more >JavaScript TextDecoder and TextEncoder - W3docs
In this chapter, we are going to explore TextEncoder and TextDecoder in JavaScript. Imagine that the binary data is a string. For example,...
Read more >TextEncoder & TextDecoder | Can I use... Support ... - CanIUse
TextEncoder encodes a JavaScript string into bytes using the UTF-8 encoding and returns the resulting Uint8Array of those bytes. TextDecoder does the ...
Read more >TextDecoder and TextEncoder in Javascript? - Tutorialspoint
TextEncoder is used to convert a given string to utf-8 standard. It retunes an Uint8Array from the string. TextDecoder is used to covert...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For those who want basic text-encoding (TextEncoder/TextDecoder), I made a fork that includes this. Based on text-encoding-polyfill as it is the most node-compatible (e.g. supports options such as
fatal
). This lets you drop in support for libraries that rely on TextEncoder/TextDecoder from node’sutil
package.Find it here: https://github.com/elliotsayes/node-util-text-encoding
React-native doesn’t provide any polyfill for TextEncoder, it would be great if util implemented it.