Languages
[Edit]
EN

JavaScript - convert bytes array to string (UTF-8)

10 points
Created by:
Blessing-D
574

In this short article, we would like to show, how to convert UTF-8 bytes array to string using JavaScript.

 

Practical examples

Edit

1. Custom solution

Edit

This example works under older web borsers and Node.js.

Short version:

 

2. Embedded solution

Edit

In this example, used solution appeard in major web browsers around 2014 and in Node.js v11.

 

See also

Edit
  1. JavaScript - convert string to bytes array

  2. JavaScript - convert string to bytes array under Node.js

References

Edit
  1. TextDecoder - MDN Docs

Alternative titles

  1. JavaScript - string from bytes array (UTF-8)
  2. JavaScript - convert utf8 bytes array to string
  3. JavaScript - convert UTF-8 bytes array to string
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join